TypeError:在降级后无法读取未定义的属性(读取“原型”)以作出反应

您所在的位置:网站首页 webpack部署 TypeError:在降级后无法读取未定义的属性(读取“原型”)以作出反应

TypeError:在降级后无法读取未定义的属性(读取“原型”)以作出反应

#TypeError:在降级后无法读取未定义的属性(读取“原型”)以作出反应| 来源: 网络整理| 查看: 265

我希望你们一切都好。我有这个问题:在尝试修复之前的错误(Uncaught Error: Module build failed (from ./node_modules/source-map-loader/dist/cjs.js))之后,我最终使用npm来处理它。但在此之后,我在控制台中看到了一个错误:path.js:25 Uncaught ReferenceError: process is not defined

此错误位于以下位置:

我的依赖关系是:

控制台错误:

[1] WARNING in ./node_modules/express/lib/view.js 74:13-25 [1] Critical dependency: the request of a dependency is an expression [1] @ ./node_modules/express/lib/application.js 26:11-28 [1] @ ./node_modules/express/lib/express.js 19:12-36 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] 1 warning has detailed information that is not shown. [1] Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it. [1] [1] ERROR in ./node_modules/cookie-signature/index.js 4:13-30 [1] Module not found: Error: Can't resolve 'crypto' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\cookie-signature' [1] [1] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. [1] This is no longer the case. Verify if you need this module and configure a polyfill for it. [1] [1] If you want to include a polyfill, you need to: [1] - add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }' [1] - install 'crypto-browserify' [1] If you don't want to include a polyfill, you can use an empty module like this: [1] resolve.fallback: { "crypto": false } [1] @ ./node_modules/express/lib/response.js 35:11-43 [1] @ ./node_modules/express/lib/express.js 27:10-31 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/destroy/index.js 12:17-41 [1] Module not found: Error: Can't resolve 'fs' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\destroy' [1] @ ./node_modules/send/index.js 19:14-32 [1] @ ./node_modules/express/lib/response.js 45:11-26 [1] @ ./node_modules/express/lib/express.js 27:10-31 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/etag/index.js 18:13-30 [1] Module not found: Error: Can't resolve 'crypto' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\etag' [1] [1] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. [1] This is no longer the case. Verify if you need this module and configure a polyfill for it. [1] [1] If you want to include a polyfill, you need to: [1] - add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }' [1] - install 'crypto-browserify' [1] If you don't want to include a polyfill, you can use an empty module like this: [1] resolve.fallback: { "crypto": false } [1] @ ./node_modules/express/lib/utils.js 25:11-26 [1] @ ./node_modules/express/lib/application.js 30:18-48 32:25-62 34:19-50 [1] @ ./node_modules/express/lib/express.js 19:12-36 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/etag/index.js 20:12-31 [1] Module not found: Error: Can't resolve 'fs' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\etag' [1] @ ./node_modules/express/lib/utils.js 25:11-26 [1] @ ./node_modules/express/lib/application.js 30:18-48 32:25-62 34:19-50 [1] @ ./node_modules/express/lib/express.js 19:12-36 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/express/lib/application.js 28:11-26 [1] Module not found: Error: Can't resolve 'http' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\express\lib' [1] [1] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. [1] This is no longer the case. Verify if you need this module and configure a polyfill for it. [1] [1] If you want to include a polyfill, you need to: [1] - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }' [1] - install 'stream-http' [1] If you don't want to include a polyfill, you can use an empty module like this: [1] resolve.fallback: { "http": false } [1] @ ./node_modules/express/lib/express.js 19:12-36 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/express/lib/request.js 18:11-30 [1] Module not found: Error: Can't resolve 'net' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\express\lib' [1] @ ./node_modules/express/lib/express.js 25:10-30 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/express/lib/request.js 22:11-26 [1] Module not found: Error: Can't resolve 'http' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\express\lib' [1] [1] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. [1] This is no longer the case. Verify if you need this module and configure a polyfill for it. [1] [1] If you want to include a polyfill, you need to: [1] - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }' [1] - install 'stream-http' [1] If you don't want to include a polyfill, you can use an empty module like this: [1] resolve.fallback: { "http": false } [1] @ ./node_modules/express/lib/express.js 25:10-30 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/express/lib/response.js 23:11-26 [1] Module not found: Error: Can't resolve 'http' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\express\lib' [1] [1] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. [1] This is no longer the case. Verify if you need this module and configure a polyfill for it. [1] [1] If you want to include a polyfill, you need to: [1] - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }' [1] - install 'stream-http' [1] If you don't want to include a polyfill, you can use an empty module like this: [1] resolve.fallback: { "http": false } [1] @ ./node_modules/express/lib/express.js 27:10-31 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/express/lib/view.js 18:9-22 [1] Module not found: Error: Can't resolve 'fs' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\express\lib' [1] @ ./node_modules/express/lib/application.js 26:11-28 [1] @ ./node_modules/express/lib/express.js 19:12-36 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/mime/mime.js 3:9-22 [1] Module not found: Error: Can't resolve 'fs' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\mime' [1] @ ./node_modules/send/index.js 31:11-26 [1] @ ./node_modules/express/lib/response.js 45:11-26 [1] @ ./node_modules/express/lib/express.js 27:10-31 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/send/index.js 29:9-22 [1] Module not found: Error: Can't resolve 'fs' in 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\send' [1] @ ./node_modules/express/lib/response.js 45:11-26 [1] @ ./node_modules/express/lib/express.js 27:10-31 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] ERROR in ./node_modules/zlib/lib/zlib.js [1] Module build failed (from ./node_modules/source-map-loader/dist/cjs.js): [1] Error: ENOENT: no such file or directory, open 'C:\Users\tatup\Desktop\GrowApp\frontend\node_modules\zlib\lib\zlib.js' [1] @ ./node_modules/body-parser/lib/read.js 20:11-26 [1] @ ./node_modules/body-parser/lib/types/json.js 21:11-29 [1] @ ./node_modules/body-parser/index.js 134:15-42 [1] @ ./node_modules/express/lib/express.js 13:17-39 [1] @ ./node_modules/express/index.js 10:0-41 [1] @ ./src/pages/LogIn.js 6:0-35 [1] @ ./src/App.js 8:0-34 34:40-45 [1] @ ./src/index.js 9:0-24 15:35-38 [1] [1] 11 errors have detailed information that is not shown. [1] Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it. [1] [1] webpack 5.66.0 compiled with 12 errors and 1 warning in 277 ms

我试过的是:

install

Remove 删除node_modules和包锁并重新运行npm包路径,dotenvDowngrading react script到v4.0.7并添加到devdep“react error-overlay”:"^6.0.9"Installing控制台错误

上显示的一些模块

如果有人能帮我,我会很高兴的,我找不到解决这个问题的方法,也不知道为什么会这样。

你可以访问这个应用程序:https://growapp.ngrok.io/

在降级后更新以响应-脚本v4.0.3再次指出错误是固定的。但是现在应用程序抛出了这个错误:

TypeError: Cannot read properties of undefined (reading 'prototype') (anonymous function) C:/Users/tatup/Desktop/GrowApp/frontend/node_modules/express/lib/response.js:42 39 | * @public 40 | */ 41 | > 42 | var res = Object.create(http.ServerResponse.prototype) 43 | 44 | /** 45 | * Module exports. View compiled ./node_modules/express/lib/response.js https://growapp.ngrok.io/static/js/vendors~main.chunk.js:42203:30 __webpack_require__

我的快速实例创建:

import express from 'express' const app = express()

我不能使用require,因为我需要在package.json中将类型更改为模块。

有线索吗?谢谢



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3