React Native中的Firebase Cloud Functions deply错误-文件中的冲突和重新声明错误

0x6upsns  于 2023-11-21  发布在  React
关注(0)|答案(1)|浏览(159)

我正在尝试在React Native中将基本的云函数部署到一个现有的Firebase Web应用程序中,我已经在另一个Web应用程序中使用了该Web应用程序。firebase deploy命令在Web应用程序中成功运行,但是在RN中,部署失败并出现了很多错误。几乎所有的错误都是关于node_modules中文件内的冲突和重新声明。我删除了functions文件夹并重新初始化,但仍然无法工作。
这里的代码

import * as functions from 'firebase-functions'

export const helloWorld = functions.https.onRequest((req, res) => {
    res.send("Hello from Firebase!");
})

字符串
错误代码:

../node_modules/@types/react-native/globals.d.ts:473:14 - error TS2717: Subsequent property declarations must have the same type.  Property 'error' must be of type 'DOMException | null', but here has type 'Error | null'.

473     readonly error: Error | null;
                 ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5368:14
    5368     readonly error: DOMException | null;
                      ~~~~~
    'error' was also declared here.

../node_modules/@types/react-native/globals.d.ts:481:14 - error TS2717: Subsequent property declarations must have the same type.  Property 'result' must be of type 'string | ArrayBuffer | null', but here has type 'string | ArrayBuffer'.

481     readonly result: string | ArrayBuffer;
                 ~~~~~~

.......

179 declare var Request: {
                ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:11731:13
    11731 declare var Request: {
                      ~~~~~~~
    'Request' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:184:14 - error TS2300: Duplicate identifier 'RequestInfo'.

184 declare type RequestInfo = Request | string;
                 ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:18345:6
    18345 type RequestInfo = Request | string;
               ~~~~~~~~~~~
    'RequestInfo' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:187:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'headers' must be of type 'HeadersInit | undefined', but here has type 'HeadersInit_ | undefined'.

187   headers?: HeadersInit_ | undefined;
      ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1623:5
    1623     headers?: HeadersInit;
             ~~~~~~~
    'headers' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:203:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'Response' must be of type '{ new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response; prototype: Response; error(): Response; redirect(url: string | URL, status?: number | undefined): Response; }', but here has type '{ new (body?: BodyInit_ | undefined, init?: ResponseInit | undefined): Response; prototype: Response; error: () => Response; redirect: (url: string, status?: number | undefined) => Response; }'.

203 declare var Response: {
                ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:11782:13
    11782 declare var Response: {
                      ~~~~~~~~
    'Response' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:265:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'DONE' must be of type 'number', but here has type '4'.

265   readonly DONE: 4;
               ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17165:14
    17165     readonly DONE: number;
                       ~~~~
    'DONE' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:266:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'HEADERS_RECEIVED' must be of type 'number', but here has type '2'.

266   readonly HEADERS_RECEIVED: 2;
               ~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17166:14
    17166     readonly HEADERS_RECEIVED: number;
                       ~~~~~~~~~~~~~~~~
    'HEADERS_RECEIVED' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:267:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'LOADING' must be of type 'number', but here has type '3'.

267   readonly LOADING: 3;
               ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17167:14
    17167     readonly LOADING: number;
                       ~~~~~~~
    'LOADING' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:268:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'OPENED' must be of type 'number', but here has type '1'.

268   readonly OPENED: 1;
               ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17168:14
    17168     readonly OPENED: number;
                       ~~~~~~
    'OPENED' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:269:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'UNSENT' must be of type 'number', but here has type '0'.

269   readonly UNSENT: 0;
               ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17169:14
    17169     readonly UNSENT: number;
                       ~~~~~~
    'UNSENT' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:282:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'XMLHttpRequest' must be of type '{ new (): XMLHttpRequest; prototype: XMLHttpRequest; readonly DONE: number; readonly HEADERS_RECEIVED: number; readonly LOADING: number; readonly OPENED: number; readonly UNSENT: number; }', but here has type '{ new (): XMLHttpRequest; prototype: XMLHttpRequest; readonly DONE: 4; readonly HEADERS_RECEIVED: 2; readonly LOADING: 3; readonly OPENED: 1; readonly UNSENT: 0; }'.

282 declare var XMLHttpRequest: {
                ~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17176:13
    17176 declare var XMLHttpRequest: {
                      ~~~~~~~~~~~~~~
    'XMLHttpRequest' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:293:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'abort' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

293   abort: ProgressEvent;
      ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17187:5
    17187     "abort": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~
    'abort' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:294:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'error' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

294   error: ProgressEvent;
      ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17188:5
    17188     "error": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~
    'error' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:295:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'load' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

295   load: ProgressEvent;
      ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17189:5
    17189     "load": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~
    'load' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:296:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'loadend' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

296   loadend: ProgressEvent;
      ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17190:5
    17190     "loadend": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~
    'loadend' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:297:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'loadstart' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

297   loadstart: ProgressEvent;
      ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17191:5
    17191     "loadstart": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~~~
    'loadstart' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:298:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'progress' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

298   progress: ProgressEvent;
      ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17192:5
    17192     "progress": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~~
    'progress' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:299:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'timeout' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

299   timeout: ProgressEvent;
      ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17193:5
    17193     "timeout": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~
    'timeout' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:352:14 - error TS2300: Duplicate identifier 'XMLHttpRequestResponseType'.

352 declare type XMLHttpRequestResponseType =
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:18505:6
    18505 type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
               ~~~~~~~~~~~~~~~~~~~~~~~~~~
    'XMLHttpRequestResponseType' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:365:15 - error TS2300: Duplicate identifier 'URL'.

365 declare class URL {
                  ~~~

  node_modules/typescript/lib/lib.dom.d.ts:14499:11
    14499 interface URL {
                    ~~~
    'URL' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:14516:13
    14516 declare var URL: {
                      ~~~
    and here.

../node_modules/react-native/types/modules/globals.d.ts:390:15 - error TS2300: Duplicate identifier 'URLSearchParams'.

390 declare class URLSearchParams {
                  ~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:14526:11
    14526 interface URLSearchParams {
                    ~~~~~~~~~~~~~~~
    'URLSearchParams' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:14545:13
    14545 declare var URLSearchParams: {
                      ~~~~~~~~~~~~~~~
    and here.
  node_modules/typescript/lib/lib.dom.iterable.d.ts:263:11
    263 interface URLSearchParams {
                  ~~~~~~~~~~~~~~~
    and here.

../node_modules/react-native/types/modules/globals.d.ts:448:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'onopen' must be of type '((this: WebSocket, ev: Event) => any) | null', but here has type '(() => void) | null'.

448   onopen: (() => void) | null;
      ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16721:5
    16721     onopen: ((this: WebSocket, ev: Event) => any) | null;
              ~~~~~~
    'onopen' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:449:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'onmessage' must be of type '((this: WebSocket, ev: MessageEvent<any>) => any) | null', but here has type '((event: WebSocketMessageEvent) => void) | null'.

449   onmessage: ((event: WebSocketMessageEvent) => void) | null;
      ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16720:5
    16720     onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
              ~~~~~~~~~
    'onmessage' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:450:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'onerror' must be of type '((this: WebSocket, ev: Event) => any) | null', but here has type '((event: WebSocketErrorEvent) => void) | null'.

450   onerror: ((event: WebSocketErrorEvent) => void) | null;
      ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16719:5
    16719     onerror: ((this: WebSocket, ev: Event) => any) | null;
              ~~~~~~~
    'onerror' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:451:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'onclose' must be of type '((this: WebSocket, ev: CloseEvent) => any) | null', but here has type '((event: WebSocketCloseEvent) => void) | null'.

451   onclose: ((event: WebSocketCloseEvent) => void) | null;
      ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16718:5
    16718     onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
              ~~~~~~~
    'onclose' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:452:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'addEventListener' must be of type '{ <K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }', but here has type 'WebsocketEventListener'.

452   addEventListener: WebsocketEventListener;
      ~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16736:5
    16736     addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'addEventListener' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:453:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'removeEventListener' must be of type '{ <K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }', but here has type 'WebsocketEventListener'.

453   removeEventListener: WebsocketEventListener;
      ~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16738:5
    16738     removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'removeEventListener' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:456:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'WebSocket' must be of type '{ new (url: string | URL, protocols?: string | string[] | undefined): WebSocket; prototype: WebSocket; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number; }', but here has type '{ new (uri: string, protocols?: string | string[] | null | undefined, options?: { [optionName: string]: any; headers: { [headerName: string]: string; }; } | null | undefined): WebSocket; ... 4 more ...; readonly OPEN: number; }'.

456 declare var WebSocket: {
                ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16742:13
    16742 declare var WebSocket: {
                      ~~~~~~~~~
    'WebSocket' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:480:15 - error TS2300: Duplicate identifier 'AbortSignal'.

480 declare class AbortSignal implements EventTarget {
                  ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:2059:11
    2059 interface AbortSignal extends EventTarget {
                   ~~~~~~~~~~~
    'AbortSignal' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:2071:13
    2071 declare var AbortSignal: {
                     ~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:60:11
    60 interface AbortSignal extends EventTarget {
                 ~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:77:13
    77 declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T}
                   ~~~~~~~~~~~
    and here.

../node_modules/react-native/types/modules/globals.d.ts:480:15 - error TS2420: Class 'AbortSignal' incorrectly implements interface 'EventTarget'.
  Property 'dispatchEvent' is missing in type 'AbortSignal' but required in type 'EventTarget'.

480 declare class AbortSignal implements EventTarget {
                  ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5309:5
    5309     dispatchEvent(event: Event): boolean;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'dispatchEvent' is declared here.

../node_modules/react-native/types/modules/globals.d.ts:515:15 - error TS2300: Duplicate identifier 'AbortController'.

515 declare class AbortController {
                  ~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:2042:11
    2042 interface AbortController {
                   ~~~~~~~~~~~~~~~
    'AbortController' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:2049:13
    2049 declare var AbortController: {
                     ~~~~~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:47:11
    47 interface AbortController {
                 ~~~~~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:70:13
    70 declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T}
                   ~~~~~~~~~~~~~~~
    and here.

../node_modules/react-native/types/modules/globals.d.ts:540:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'error' must be of type 'DOMException | null', but here has type 'Error | null'.

540   readonly error: Error | null;
               ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5368:14
    5368     readonly error: DOMException | null;
                      ~~~~~
    'error' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:550:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'result' must be of type 'string | ArrayBuffer | null', but here has type 'string | ArrayBuffer'.

550   readonly result: string | ArrayBuffer;
               ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5376:14
    5376     readonly result: string | ArrayBuffer | null;
                      ~~~~~~
    'result' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:556:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'DONE' must be of type 'number', but here has type '2'.

556   readonly DONE: 2;
               ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5382:14
    5382     readonly DONE: number;
                      ~~~~
    'DONE' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:557:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'EMPTY' must be of type 'number', but here has type '0'.

557   readonly EMPTY: 0;
               ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5383:14
    5383     readonly EMPTY: number;
                      ~~~~~
    'EMPTY' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:558:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'LOADING' must be of type 'number', but here has type '1'.

558   readonly LOADING: 1;
               ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5384:14
    5384     readonly LOADING: number;
                      ~~~~~~~
    'LOADING' was also declared here.

../node_modules/react-native/types/modules/globals.d.ts:573:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'FileReader' must be of type '{ new (): FileReader; prototype: FileReader; readonly DONE: number; readonly EMPTY: number; readonly LOADING: number; }', but here has type '{ new (): FileReader; prototype: FileReader; readonly DONE: 2; readonly EMPTY: 0; readonly LOADING: 1; }'.

573 declare var FileReader: {
                ~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5391:13
    5391 declare var FileReader: {
                     ~~~~~~~~~~
    'FileReader' was also declared here.

../node_modules/react-native/types/modules/LaunchScreen.d.ts:13:16 - error TS2451: Cannot redeclare block-scoped variable 'Header'.

13   export const Header: any;
                  ~~~~~~

  ../node_modules/@types/react-native/LaunchScreen.d.ts:4:18
    4     export const Header: any;
                       ~~~~~~
    'Header' was also declared here.

../node_modules/react-native/types/modules/LaunchScreen.d.ts:14:16 - error TS2451: Cannot redeclare block-scoped variable 'LearnMoreLinks'.

14   export const LearnMoreLinks: any;
                  ~~~~~~~~~~~~~~

  ../node_modules/@types/react-native/LaunchScreen.d.ts:5:18
    5     export const LearnMoreLinks: any;
                       ~~~~~~~~~~~~~~
    'LearnMoreLinks' was also declared here.

../node_modules/react-native/types/modules/LaunchScreen.d.ts:15:16 - error TS2451: Cannot redeclare block-scoped variable 'Colors'.

15   export const Colors: any;
                  ~~~~~~

  ../node_modules/@types/react-native/LaunchScreen.d.ts:6:18
    6     export const Colors: any;
                       ~~~~~~
    'Colors' was also declared here.

../node_modules/react-native/types/modules/LaunchScreen.d.ts:16:16 - error TS2451: Cannot redeclare block-scoped variable 'DebugInstructions'.

16   export const DebugInstructions: any;
                  ~~~~~~~~~~~~~~~~~

  ../node_modules/@types/react-native/LaunchScreen.d.ts:7:18
    7     export const DebugInstructions: any;
                       ~~~~~~~~~~~~~~~~~
    'DebugInstructions' was also declared here.

../node_modules/react-native/types/modules/LaunchScreen.d.ts:17:16 - error TS2451: Cannot redeclare block-scoped variable 'ReloadInstructions'.

17   export const ReloadInstructions: any;
                  ~~~~~~~~~~~~~~~~~~

  ../node_modules/@types/react-native/LaunchScreen.d.ts:8:18
    8     export const ReloadInstructions: any;
                       ~~~~~~~~~~~~~~~~~~
    'ReloadInstructions' was also declared here.

../node_modules/react-native/types/public/DeprecatedPropertiesAlias.d.ts:10:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: TextProperties, TextPropertiesIOS, TextPropertiesAndroid, AccessibilityProperties, AccessibilityPropertiesIOS, AccessibilityPropertiesAndroid, TextInputProperties, TextInputIOSProperties, TextInputAndroidProperties, ViewProperties, ViewPropertiesIOS, ViewPropertiesAndroid, ScrollViewProperties, ScrollViewPropertiesIOS, ScrollViewPropertiesAndroid, InputAccessoryViewProperties, ActivityIndicatorProperties, ActivityIndicatorIOSProperties, DrawerLayoutAndroidProperties, ProgressBarAndroidProperties, RefreshControlProperties, RefreshControlPropertiesIOS, RefreshControlPropertiesAndroid, ImagePropertiesSourceOptions, ImageProperties, ImagePropertiesIOS, ImagePropertiesAndroid, ImageBackgroundProperties, FlatListProperties, VirtualizedListProperties, SectionListProperties, ModalProperties, TouchableWithoutFeedbackProperties, TouchableHighlightProperties, TouchableOpacityProperties, TouchableNativeFeedbackProperties, ButtonProperties, StatusBarProperties, StatusBarPropertiesIOS, StatusBarPropertiesAndroid, SwitchProperties, SwitchPropertiesIOS

10 import {
   ~~~~~~

  ../node_modules/@types/react-native/legacy-properties.d.ts:1:1
    1 import {
      ~~~~~~
    Conflicts are in this file.

Found 156 errors in 19 files.

Errors  Files
     4  node_modules/@types/node/globals.d.ts:47
    12  node_modules/typescript/lib/lib.dom.d.ts:2042
     2  node_modules/typescript/lib/lib.dom.iterable.d.ts:86
     1  ../node_modules/@types/react-native-vector-icons/Icon.d.ts:8
     3  ../node_modules/@types/react-native/BatchedBridge.d.ts:8
     1  ../node_modules/@types/react-native/Codegen.d.ts:1
     1  ../node_modules/@types/react-native/Devtools.d.ts:2
    45  ../node_modules/@types/react-native/globals.d.ts:10
     5  ../node_modules/@types/react-native/index.d.ts:9939
     5  ../node_modules/@types/react-native/LaunchScreen.d.ts:4
    15  ../node_modules/@types/react-native/legacy-properties.d.ts:1
     1  ../node_modules/@types/react/ts5.0/global.d.ts:152
     5  ../node_modules/react-native/types/index.d.ts:200
     3  ../node_modules/react-native/types/modules/BatchedBridge.d.ts:17
     1  ../node_modules/react-native/types/modules/Codegen.d.ts:10
     1  ../node_modules/react-native/types/modules/Devtools.d.ts:11
    45  ../node_modules/react-native/types/modules/globals.d.ts:19
     5  ../node_modules/react-native/types/modules/LaunchScreen.d.ts:13
     1  ../node_modules/react-native/types/public/DeprecatedPropertiesAlias.d.ts:10

Error: functions predeploy error: Command terminated with non-zero exit code 2

zzlelutf

zzlelutf1#

尝试将这一行添加到functions文件夹中的tslog.json中。
“typeRoots”:[“node_modules/@types”],

相关问题