Closed warkcod closed 1 year ago
同问。。。。
如果你在客户端代码中使用了fs模块,你需要在你的package.json文件中设置browser.fs属性为false。例如:
{ "name": "my-app", "version": "1.0.0", "browser": { "fs": false }, "dependencies": { // ... } }
这样,Webpack就不会尝试在客户端打包fs模块了。
{ "name": "your-app-name", "version": "1.0.0", "dependencies": { // your dependencies }, "browser": { "fs": false } } 这样就可以了
最新的代码已解决该问题
错误描述 🤔
本地编译的时候遇到如下错误: error - ./node_modules/next/dist/compiled/@vercel/og/index.node.js:17950:0 Module not found: Can't resolve 'fs'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module: ./node_modules/next/dist/server/web/spec-extension/image-response.js ./node_modules/next/server.js ./node_modules/@supabase/auth-helpers-nextjs/dist/index.js ./pages/_app.tsx wait - compiling... error - ./node_modules/next/dist/compiled/@vercel/og/index.node.js:17950:0 Module not found: Can't resolve 'fs'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module: ./node_modules/next/dist/server/web/spec-extension/image-response.js ./node_modules/next/server.js ./node_modules/@supabase/auth-helpers-nextjs/dist/index.js ./pages/_app.tsx
请问有什么详细的说明?.env是从example里复制生成的,把相关内容字段填了,出现了如上错误 翻了前面报的bug貌似也有人提到这个问题,但是没有专门一个issue处理,麻烦看下?必要的话更新下相关说明,谢谢