Uncaught ReferenceError: process is not defined (create-react-app 5.0.0)
Uncaught ReferenceError: process is not defined (create-react-app 5.0.0)
我已将我的 React 应用程序迁移到 react-scripts 5.0.0,现在我收到此错误:
path.js:25 Uncaught ReferenceError: process is not defined
at Object../node_modules/path/path.js (path.js:25:1)
at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:61:1)
at Object../node_modules/mime-types/index.js (index.js:16:1)
at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:61:1)
at Object../node_modules/react-s3-uploader/s3upload.js (s3upload.js:6:1)
at Object.options.factory (react refresh:6:1)
这是来自 path.js 的行:
var isWindows = process.platform === 'win32';
github https://github.com/facebook/create-react-app/issues/11773 上有一个问题说这种错误是由错误的 react-error-overlay 版本引起的,但对我来说似乎不是这样。我已经尝试了这个问题的所有解决方案,但错误仍然存在
$ npm why react-error-overlay [20:54:29]
react-error-overlay@6.0.9
node_modules/react-error-overlay
dev react-error-overlay@"6.0.9" from the root project
将 react-scripts 降级到 4.0.3 解决了我的问题
我已将我的 React 应用程序迁移到 react-scripts 5.0.0,现在我收到此错误:
path.js:25 Uncaught ReferenceError: process is not defined
at Object../node_modules/path/path.js (path.js:25:1)
at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:61:1)
at Object../node_modules/mime-types/index.js (index.js:16:1)
at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:61:1)
at Object../node_modules/react-s3-uploader/s3upload.js (s3upload.js:6:1)
at Object.options.factory (react refresh:6:1)
这是来自 path.js 的行:
var isWindows = process.platform === 'win32';
github https://github.com/facebook/create-react-app/issues/11773 上有一个问题说这种错误是由错误的 react-error-overlay 版本引起的,但对我来说似乎不是这样。我已经尝试了这个问题的所有解决方案,但错误仍然存在
$ npm why react-error-overlay [20:54:29]
react-error-overlay@6.0.9
node_modules/react-error-overlay
dev react-error-overlay@"6.0.9" from the root project
将 react-scripts 降级到 4.0.3 解决了我的问题