react-native 创建捆绑包发布JavaScript和资源\index.android.bundle:1322:18:警告:变量"DebuggerInternal"在函数"__shouldPauseOnThrow"中未声明,typeof DebuggerInternal !== 'undefined'

bgibtngc  于 5个月前  发布在  React
关注(0)|答案(7)|浏览(72)

描述

React Native0.74.3
构建发布包
"apk": "cd android && ./gradlew aR",
"aab": "cd android && ./gradlew bundleRelease"
打包成功,程序可以正常使用,但输出了许多警告
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
^~~~~~~~~~~~~~
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

gk7wooem

gk7wooem1#

⚠️缺失可复现示例
i️我们无法在您的问题报告中检测到可复现的示例。请提供以下内容:* 如果您的错误与UI相关:一个 Snack* 如果您的错误与构建/更新相关:使用我们的 Reproducer Template 。需要在您用户名下的GitHub仓库中有一个复现器。
jtw3ybtb

jtw3ybtb2#

⚠️缺失可复现示例
i️我们无法在您的问题报告中检测到可复现的示例。请提供以下内容:* 如果您的错误与UI相关:一个 Snack* 如果您的错误与构建/更新相关:使用我们的 Reproducer Template
8ljdwjyq

8ljdwjyq5#

这些都是警告,不应该影响您的正常开发。@FTW-001

guz6ccqo

guz6ccqo6#

是的,这并不影响程序的运行和使用,但我无法确定这些警告的原因或是否存在任何潜在危险,所以我想了解更多信息。

wz3gfoph

wz3gfoph7#

是的,这并不影响程序的运行和使用,但我无法确定这些警告的原因或是否存在任何隐藏的危险,所以我想了解更多。
这些警告是由Metro发出的,针对React Native内部的源代码。
您非常欢迎修复它们并提交PR,我们将非常乐意合并它

相关问题