打破变化:WebPack< 5用于包括node.js核心模块的polyfills,默认情况下... polyfill

发布于 2025-01-27 08:25:58 字数 417 浏览 2 评论 0原文

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

“打破变化:webpack< 5用于默认情况下包括node.js核心模块的polyfills。 情况不再如此。验证是否需要此模块并为其配置多填充。

如果要包含一个polyfill,则需要:

  • 添加后备'resolve.fallback:{“ querystring”:require.resolve(“ queryString-es3”)}'
  • stlins nastion queryString-es3' 如果您不想包含polyfill,则可以使用这样的空模块: resolve.fallback:{“ querystring”:false}“

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

So I am creating an Instagram clone using React.js and Firebase, and ran into an issue while working on the file upload portion of the app. The error read:

"BREAKING CHANGE: 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.

If you want to include a polyfill, you need to:

  • add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
  • install 'querystring-es3'
    If you don't want to include a polyfill, you can use an empty module like this:
    resolve.fallback: { "querystring": false }"

I am beyond confused on how to move forward...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里寻她 2025-02-03 08:25:58

看起来“ querystring”已经被描述了,我的npm run build命令在某个地方使用了这一行,我

//import { stringify } from 'querystring';

对此进行了评论:并使用:

JSON.stringify()

查看上述错误,我尝试安装了我尝试安装的错误
npm i querystring-es3
最终,我不需要它,并卸载了同样的内容。

Looks like 'querystring' was depricated and my npm run build command is freaking out as this line was used somewhere, which I commented out:

//import { stringify } from 'querystring';

And use this instead:

JSON.stringify()

Looking at the above mentioned error I tried installing
npm i querystring-es3
Eventually I didn't need that and uninstalled the same.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文