【问题标题】:module not found: Error: Can't resolve 'pnpapi' in '/app/node_modules/next/dist/lib'找不到模块:错误:无法解析“/app/node_modules/next/dist/lib”中的“pnpapi”
【发布时间】:2021-02-20 17:55:02
【问题描述】:

我尝试构建我的 next.js 应用程序并遇到了这个错误,它破坏了我的应用程序。

找不到模块:错误:无法解析“/app/node_modules/next/dist/lib”中的“pnpapi”

> Build error occurred
Error: > Build failed because of webpack errors
   at build (/app/node_modules/next/dist/build/index.js:15:918)
   at process._tickCallback (internal/process/next_tick.js:68:7

【问题讨论】:

    标签: reactjs webpack next.js


    【解决方案1】:
    const { HotModuleReplacementPlugin } = require("webpack");
    

    此导入出现在我的代码中,在我的应用程序的索引中。 我删除了它,webpack 又可以工作了。

    【讨论】:

      猜你喜欢
      • 2019-06-13
      • 2021-01-30
      • 2021-01-13
      • 1970-01-01
      • 2019-10-16
      • 2021-02-21
      • 2022-08-07
      • 2021-11-17
      • 2019-07-15
      相关资源
      最近更新 更多