【问题标题】:I am having issues importing react instagram in my project我在我的项目中导入 react instagram 时遇到问题
【发布时间】:2022-10-05 21:58:57
【问题描述】:

我使用npm i react-instagram-embed 安装了它。但是,当我尝试使用以下命令将其导入项目时,它给了我一个错误:

import InstagramEmbed from \'react-instagram-embed.

它返回以下错误

Module not found: Error: Can\'t resolve \'querystring\' in \'/home/marcos/Desktop/REACT/Instagram-clone/instagram/node_modules/react-instagram-embed/es\'

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 }
  • 您的导入语句中有一个错字。
  • 请再次出现,您介意详细说明吗
  • 我让你假设缺少结束语,我在发布问题时错过了它
  • 您是否尝试过实际错误消息中提出的各种解决方案?
  • 是的,我做到了,我对反应有点陌生,所以我在解决此类错误时遇到了一些问题

标签: reactjs


【解决方案1】:

有人请告诉这个问题的解决方案,我也面临同样的问题。我还安装了 querystring-es3,但仍然遇到同样的错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-08
    • 1970-01-01
    • 1970-01-01
    • 2021-07-30
    • 1970-01-01
    • 2019-05-05
    • 2021-02-15
    • 1970-01-01
    相关资源
    最近更新 更多