下一个 JS:模块解析失败:意外字符“?” (1:0)

Din*_*191 6 next.js

模块解析失败: 意外字符 \'\xef\xbf\xbd\' (1:0)\n您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件。请参阅https://webpack.js.org/concepts#loaders \n(此二进制文件省略源代码)

\n

导入图像时出错。

\n

有谁知道为什么会发生这种情况?

\n

我正在使用nextjs

\n

Pra*_*bhu 0

在 next.config.js 中导入 next-images

const withImages = require('next-images')
Run Code Online (Sandbox Code Playgroud)

并在 module.exports 中使用它,就像

module.exports = withImages({ ...//your content here })
Run Code Online (Sandbox Code Playgroud)