梦幻联动啦 上篇帖子中引用完 @jsonforms时出现如下几个报错
1、ERROR in ./node_modules/json-schema-ref-parser/lib/resolvers/http.js 3:13-28
2、ERROR in ./node_modules/json-schema-ref-parser/lib/resolvers/http.js 5:14-30
3、ERROR in ./node_modules/json-schema-ref-parser/lib/util/url.js 11:0-36
控制台报错内容如下
Uncaught ReferenceError: process is not defined
at Object../node_modules/json-schema-ref-parser/lib/util/url.js
at Object.options.factory (react refresh:6)
at _webpack_require_(bootstrap:24)
at fn (hot module replacement:61)
at Object../node_modules/json-schema-ref-parser/lib/resolvers/file.js (file.js:4)
at _webpack_require_(bootstrap:24)
at fn (hot module replacement:61)
at Object../node_modules/json-schema-ref-parser/lib/options.js (options.js:8)
at Object.options.factory (react refresh:6)
解决方案:网上搜索Uncaught ReferenceError: process is not defined有千百种解决方案 但无一能解决我的bug (有点费脑) 重点看报错中的这句 “BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.” 然后我看了一下我的webpack在项目中是 5.0.0版本
在package.json中 将其改为 4.0.1
然后运行 npm install
最后运行 npm start 该问题即被解决