facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.14k stars 24.21k forks source link

createBundleReleaseJsAndAssets\index.android.bundle:1322:18: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow" typeof DebuggerInternal !== 'undefined' #45636

Open FTW-001 opened 1 month ago

FTW-001 commented 1 month ago

Description

React Native0.74.3
Build release package "apk": "cd android && ./gradlew aR", "aab": "cd android && ./gradlew bundleRelease" The packaging was successful and the program can be used normally, but it outputs many warnings

android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:1322:18: warning: the variable "DebuggerInternal" was not declared in function "shouldPauseOnThrow" typeof DebuggerInternal !== 'undefined' && ^~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:6550:7: warning: the variable "setTimeout" was not declared in function "logCapturedError" setTimeout(function () { ^~~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:4660:31: warning: the variable "nativeFabricUIManager" was not declared in anonymous function " 133#" var _nativeFabricUIManage = nativeFabricUIManager, ^~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:4688:21: warning: the variable "clearTimeout" was not declared in anonymous function " 133#" cancelTimeout = clearTimeout; ^~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:9318:30: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK" was not declared in anonymous function " 133#" if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { ^~~~~~~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:11730:5: warning: the variable "setImmediate" was not declared in function "handleResolved" setImmediate(function () { ^~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16001:12: warning: the variable "fetch" was not declared in anonymous function " 369#" fetch: fetch, ^~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16002:14: warning: the variable "Headers" was not declared in anonymous function " 369#" Headers: Headers, ^~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16003:14: warning: the variable "Request" was not declared in anonymous function " 369#" Request: Request, ^~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16004:15: warning: the variable "Response" was not declared in anonymous function " 369#" Response: Response ^~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16161:24: warning: the variable "FileReader" was not declared in function "readBlobAsArrayBuffer" var reader = new FileReader(); ^~~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16212:36: warning: the variable "Blob" was not declared in anonymous function " 380#" } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { ^~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16214:40: warning: the variable "FormData" was not declared in anonymous function " 380#" } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { ^~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16216:44: warning: the variable "URLSearchParams" was not declared in anonymous function " 380#" ...e if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body... ^~~~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16335:26: warning: the variable "AbortController" was not declared in anonymous function " 386#" var ctrl = new AbortController(); ^~~~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16469:23: warning: the variable "XMLHttpRequest" was not declared in anonymous function " 390#" var xhr = new XMLHttpRequest(); ^~~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16014:71: warning: the variable "self" was not declared in anonymous function " 372#" ...undefined' && globalThis || typeof self !== 'undefined' && self || ^~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:26274:27: warning: the variable "performance" was not declared in anonymous function " 685#" if ("object" === typeof performance && "function" === typeof performance.no... ^~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:26297:26: warning: the variable "navigator" was not declared in anonymous function " 685#" "undefined" !== typeof navigator && undefined !== navigator.scheduling && u... ^~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:26407:37: warning: the variable "MessageChannel" was not declared in anonymous function " 685#" };else if ("undefined" !== typeof MessageChannel) { ^~~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:26422:34: warning: the variable "nativeRuntimeScheduler" was not declared in anonymous function " 685#" ... = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.... ^~~~~~ android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:35520:34: warning: the variable "requestAnimationFrame" was not declared in function "start 9#" ... this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); ^~~~~

Steps to reproduce

1 Set up development environment 2 Configure Android environment and run successfully 3 Configuration packaging (release) These warnings will not be prompted in the development environment, only in the production environment

React Native Version

0.74.3

Affected Platforms

Runtime - Android, Build - Windows

Areas

Other (please specify)

Output of npx react-native info

windwo 10
android     
        buildToolsVersion = "34.0.0"
        minSdkVersion = 23
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "26.1.10909125"
        kotlinVersion = "1.9.22"
node 18.20.4

Stacktrace or Logs

android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:1322:18: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow"
          typeof DebuggerInternal !== 'undefined' &&
                 ^~~~~~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:6550:7: warning: the variable "setTimeout" was not declared in function "logCapturedError"
      setTimeout(function () {
      ^~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:4660:31: warning: the variable "nativeFabricUIManager" was not declared in anonymous function " 133#"
  var _nativeFabricUIManage = nativeFabricUIManager,
                              ^~~~~~~~~~~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:4688:21: warning: the variable "clearTimeout" was not declared in anonymous function " 133#"
    cancelTimeout = clearTimeout;
                    ^~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:9318:30: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in anonymous function " 133#"
  if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:11730:5: warning: the variable "setImmediate" was not declared in function "handleResolved"
    setImmediate(function () {
    ^~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16001:12: warning: the variable "fetch" was not declared in anonymous function " 369#"
    fetch: fetch,
           ^~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16002:14: warning: the variable "Headers" was not declared in anonymous function " 369#"
    Headers: Headers,
             ^~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16003:14: warning: the variable "Request" was not declared in anonymous function " 369#"
    Request: Request,
             ^~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16004:15: warning: the variable "Response" was not declared in anonymous function " 369#"
    Response: Response
              ^~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16161:24: warning: the variable "FileReader" was not declared in function "readBlobAsArrayBuffer"
      var reader = new FileReader();
                       ^~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16212:36: warning: the variable "Blob" was not declared in anonymous function
" 380#"
        } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
                                   ^~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16214:40: warning: the variable "FormData" was not declared in anonymous function " 380#"
        } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
                                       ^~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16216:44: warning: the variable "URLSearchParams" was not declared in anonymous function " 380#"
...e if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body...
                                 ^~~~~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16335:26: warning: the variable "AbortController" was not declared in anonymous function " 386#"
          var ctrl = new AbortController();
                         ^~~~~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16469:23: warning: the variable "XMLHttpRequest" was not declared in anonymous function " 390#"
        var xhr = new XMLHttpRequest();
                      ^~~~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:16014:71: warning: the variable "self" was not declared in anonymous function
" 372#"
...undefined' && globalThis || typeof self !== 'undefined' && self ||
                                      ^~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:26274:27: warning: the variable "performance" was not declared in anonymous function " 685#"
  if ("object" === typeof performance && "function" === typeof performance.no...
                          ^~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:26297:26: warning: the variable "navigator" was not declared in anonymous function " 685#"
  "undefined" !== typeof navigator && undefined !== navigator.scheduling && u...
                         ^~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:26407:37: warning: the variable "MessageChannel" was not declared in anonymous function " 685#"
  };else if ("undefined" !== typeof MessageChannel) {
                                    ^~~~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:26422:34: warning: the variable "nativeRuntimeScheduler" was not declared in anonymous function " 685#"
... = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler....
                             ^~~~~~~~~~~~~~~~~~~~~~
android\app\build\generated\assets\createBundleReleaseJsAndAssets\index.android.bundle:35520:34: warning: the variable "requestAnimationFrame" was not declared in function "start 9#"
...    this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
                              ^~~~~~~~~~~~~~~~~~~~~

Reproducer

.

Screenshots and Videos

image

react-native-bot commented 1 month ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 1 month ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
FTW-001 commented 1 month ago

https://github.com/FTW-001/rn/tree/main/ReproducerApp

FTW-001 commented 1 month ago

image

cortinico commented 1 month ago

Those are warnings and should not affect your regular development @FTW-001

FTW-001 commented 1 month ago

Yes, this does not affect the operation and use of the program, but I cannot determine the cause of these warnings or whether there are any hidden dangers, so I would like to know more.

cortinico commented 1 month ago

Yes, this does not affect the operation and use of the program, but I cannot determine the cause of these warnings or whether there are any hidden dangers, so I would like to know more.

Those are warnings emitted by Metro for source code inside React Native. You're more than welcome to fix them and send up a PR, we'll be more than happy to merge it