Module not found Error Can’t resolve ‘encoding’ when deploying Next

4 min read

You can resolve this problem by
您可以通过以下方式解决此问题

  • Run yarn add encoding in your project directory
    在项目目录中运行 yarn add encoding
  • Clear the next directory in your project by running rm -rf .next in the project directory
    通过在项目目录中运行 rm -rf .next 来清除项目中的下一个目录
  • Re-running xdn deploy 重新运行 xdn deploy

Note that you’ll also need to put your BigCommerce API keys in .env.local as well for the deploy to successfully complete.
请注意,您还需要将BigCommerce API密钥放在 .env.local 中,以便成功完成部署。