我正在使用next.js,我得到:
Failed to compile.
./node_modules/fsevents/fsevents.node 1:0
Module parse failed: Unexpected character '?' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
Run Code Online (Sandbox Code Playgroud)
我几乎尝试了所有方法,最近一次package.json,我补充说:
"optionalDependencies": {
"fsevents": "^2.1.3"
}
Run Code Online (Sandbox Code Playgroud)
在next.config.js,我有:
const withImages = require("next-images");
const withPlugins = require("next-compose-plugins");
const withCSS = require("@zeit/next-css");
module.exports = withPlugins([
withCSS,
withImages,
]
Run Code Online (Sandbox Code Playgroud)
不知道还能做什么。
小智 5
我通过添加以下内容在我的 VS Code 扩展中修复了它:
{
test: /.node$/,
loader: 'node-loader',
}
Run Code Online (Sandbox Code Playgroud)
在module.rules中webpack.config.js
和添加:
"node-loader": "^1.0.1",
Run Code Online (Sandbox Code Playgroud)
在devDependencies中package.json
| 归档时间: |
|
| 查看次数: |
1235 次 |
| 最近记录: |