serverless-next.js
serverless-next.js copied to clipboard
Build error {}.DEBUG = namespaces;
Describe the bug
I'm getting this error when I try to run "serverless". The next build is working fine.
Build error occurred .../.next/serverless/pages/dashboard/DashboardView.js:41448 {}.DEBUG = namespaces;
Screenshots/Code/Logs
This is the generated code that is causing the error
function save(namespaces) { if (null == namespaces) { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete {}.DEBUG; } else { {}.DEBUG = namespaces; }
Versions
- OS/Environment:
- @sls-next/serverless-component version: 1.18.0
- Next.js version: 10.0.4
it looks related to https://github.com/visionmedia/debug/issues/467
it could be a bug on dotenv-webpack plugin
@renanfeluck any update? have you resolved this issue?
same problem
same problem( Next.js version: 10.0.8 )
I have the same error using Docusaurus 2.2.0 and Node 18.18, any suggestion?
I have the same error using Docusaurus 2.2.0 and Node 18.18, any suggestion?
I chased this one down for several hours and found a workaround outline by this comment:
https://github.com/rohit-gohri/redocusaurus/issues/236#issuecomment-1449548972
From the linked discussion:
- The root cause appears to be in a node debug package. ("node_modules/debug/src/node.js")
- The workaround for this issue requires some webpack configuration magic.
- The linked comment offers a solution specific to docusaurus.
- Others may get some value from reading the linked thread to get on the right track to find a resolution for projects other than docusaurus.