serverless-next.js icon indicating copy to clipboard operation
serverless-next.js copied to clipboard

Build error {}.DEBUG = namespaces;

Open renanfeluck opened this issue 4 years ago • 6 comments

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

renanfeluck avatar Jan 06 '21 13:01 renanfeluck

it looks related to https://github.com/visionmedia/debug/issues/467

it could be a bug on dotenv-webpack plugin

sibelius avatar Jan 08 '21 13:01 sibelius

@renanfeluck any update? have you resolved this issue?

sonnguy avatar Feb 04 '21 02:02 sonnguy

same problem

lid3rs avatar Feb 24 '21 20:02 lid3rs

same problem( Next.js version: 10.0.8 )

hedrall avatar Mar 12 '21 01:03 hedrall

I have the same error using Docusaurus 2.2.0 and Node 18.18, any suggestion?

noel-reissig-xops avatar Jan 10 '24 01:01 noel-reissig-xops

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.

quicken avatar Jun 13 '24 12:06 quicken