使用 next.js,为什么我突然开始看到 Module not find: Error: Can't parse 'fs'?

Sha*_*oon 4 node.js webpack next.js

我什么也没改变,但正在使用"next": "9.4.4",我看到:

Module not found: Can't resolve 'fs' in 'web/node_modules/graceful-fs'
Could not find files for /app/d/[id] in .next/build-manifest.json
ModuleNotFoundError: Module not found: Error: Can't resolve 'fs' in 'web/node_modules/graceful-fs'
Run Code Online (Sandbox Code Playgroud)

我可能做错了什么?

Fow*_*wad 5

您似乎不在/api目录中。客户端代码将无法导入fs,只有API文件可以