重大变更:webpack < 5 used to include polyfills for node.js core modules by default... Polyfill

问题描述 投票:0回答:1

因此,我正在使用 React.js 和 Firebase 创建 Instagram 克隆,并在处理应用程序的文件上传部分时遇到了问题。错误如下:

“重大变更:webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.

如果你想包含一个polyfill,你需要:

  • 添加后备 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
  • 安装“querystring-es3” 如果你不想包含一个polyfill,你可以使用一个空模块,如下所示: 解析.fallback: { "querystring": false }"

我对如何前进感到非常困惑......

node.js reactjs polyfills
1个回答
0
投票

看起来“querystring”已被废弃,我的

npm rub build
命令吓坏了,因为这行代码在某处使用,我将其注释掉了:

//import { stringify } from 'querystring';

并用这个代替:

JSON.stringify()

看着上面提到的错误我尝试安装 npm 我查询字符串-es3 最终我不需要它并卸载了它。

© www.soinside.com 2019 - 2024. All rights reserved.