gpt4 book ai didi

javascript - 创建 react 应用程序在代码重新加载时偶尔会随机崩溃

转载 作者:行者123 更新时间:2023-12-01 00:40:01 26 4
gpt4 key购买 nike

这真是令人沮丧。我正在开发一个应用程序,这种情况在几周前开始发生,我无法确定原因。每隔一段时间,应用程序就会崩溃。如果我保存代码以触发重新加载,这种情况似乎会更频繁地发生,但它也可能在浏览器中浏览应用程序时随机崩溃。

据我所知,没有明显的错误,而且它是随机发生的。有时它会在一分钟内发生两次,有时它会持续 30 分钟而没有发生。由于我看不到任何错误,我所需要做的就是按 Control+C 并重新运行 npm start,但我的工作流程中断仍然令人沮丧。我唯一拥有的是控制台中的此错误消息:

assert.js:339
throw err;
^

AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

assert(index !== -1)

at PriorityNode.removeChild (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\priority.js:74:3)
at PriorityNode.remove (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\priority.js:62:15)
at PriorityTree.add (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\priority.js:163:23)
at Stream._initPriority (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\stream.js:101:25)
at new Stream (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\stream.js:76:8)
at Connection._createStream (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\connection.js:388:16)
at Connection._handleHeaders (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\connection.js:436:21)
at Connection._handleFrame (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\connection.js:319:10)
at Parser.<anonymous> (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\connection.js:156:10)
at Parser.emit (events.js:198:13)
at addChunk (C:\Users\Admin\Desktop\project\frontend\node_modules\readable-stream\lib\_stream_readable.js:291:12)
at readableAddChunk (C:\Users\Admin\Desktop\project\frontend\node_modules\readable-stream\lib\_stream_readable.js:278:11)
at Parser.Readable.push (C:\Users\Admin\Desktop\project\frontend\node_modules\readable-stream\lib\_stream_readable.js:245:10)
at Parser.Transform.push (C:\Users\Admin\Desktop\project\frontend\node_modules\readable-stream\lib\_stream_transform.js:148:32)
at next (C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\protocol\base\parser.js:53:12)
at C:\Users\Admin\Desktop\project\frontend\node_modules\spdy-transport\lib\spdy-transport\protocol\http2\parser.js:72:5
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2019-09-04T04_18_42_331Z-debug.log

和这个日志:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle project@0.1.0~prestart: project@0.1.0
6 info lifecycle project@0.1.0~start: project@0.1.0
7 verbose lifecycle project@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle project@0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Admin\Desktop\project\frontend\node_modules\.bin;C:\Program Files\PostgreSQL\10\lib;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Users\Admin\AppData\Local\Programs\Python\Python37-32;C:\Users\Admin\.cargo\bin;C:\Program Files\Java\jdk1.8.0_162\bin;C:\Users\Admin\.lein;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Program Files (x86)\Yarn\bin;C:\Program Files\dotnet\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\nodejs\;C:\Program Files\PostgreSQL\10\lib;C:\Users\Admin\.cargo\bin;C:\Users\Admin\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\Admin\AppData\Local\Yarn\bin;C:\Program Files\Java\jdk1.8.0_162\bin;C:\Users\Admin\AppData\Local\GitHubDesktop\bin;C:\Users\Admin\AppData\Roaming\npm
9 verbose lifecycle project@0.1.0~start: CWD: C:\Users\Admin\Desktop\project\frontend
10 silly lifecycle project@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle project@0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle project@0.1.0~start: Failed to exec start script
13 verbose stack Error: project@0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid project@0.1.0
15 verbose cwd C:\Users\Admin\Desktop\project\frontend
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.16.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error project@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the project@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

有人对可能的原因或我如何进一步调试它有任何想法吗?

最佳答案

根据此问题,您需要升级您正在使用的 spdy-transport 版本:https://github.com/spdy-http2/spdy-transport/issues/62

关于javascript - 创建 react 应用程序在代码重新加载时偶尔会随机崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57781272/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com