Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next js 11 build issues (both dev and build) #26177

Closed
wroughtec opened this issue Jun 16, 2021 · 11 comments
Closed

Next js 11 build issues (both dev and build) #26177

wroughtec opened this issue Jun 16, 2021 · 11 comments
Labels
please add a complete reproduction The issue lacks information for further investigation

Comments

@wroughtec
Copy link

wroughtec commented Jun 16, 2021

What version of Next.js are you using?

11.0.0 (& 11.0.1-canary.0)

What version of Node.js are you using?

14.17.0

What browser are you using?

NA

What operating system are you using?

Windows WSL2 (Ubuntu 20.04)

How are you deploying your application?

NA

Describe the Bug

On running dev getting the following issue when it first starts to build (has not hit the browser yet):
Files are typescript and has a custom .babelrc file. (appreciate there are a few tickets open that are probably the same issue but hopefully the strack trace will help)

Error parsing bundle asset "/.next/static/chunks/webpack.js": no such file
Error parsing bundle asset "/.next/static/chunks/react-refresh.js": no such file
Error parsing bundle asset /.next/static/chunks/pages/_app.js": no such file
Error parsing bundle asset "/.next/static/chunks/pages/_error.js": no such file
Error parsing bundle asset "/.next/static/chunks/amp.js": no such file
Error parsing bundle asset "/.next/static/chunks/polyfills.js": no such file
Error parsing bundle asset "/.next/static/chunks/main.js": no such file

No bundles were parsed. Analyzer will show only original module sizes from stats file.

Webpack Bundle Analyzer saved report to /.next/analyze/client.html
Error parsing bundle asset "/.next/server/webpack-runtime.js": no such file
Error parsing bundle asset "/.next/server/pages/_error.js": no such file
Error parsing bundle asset "/.next/server/pages/_document.js": no such file
Error parsing bundle asset "/.next/server/pages/_app.js": no such file

No bundles were parsed. Analyzer will show only original module sizes from stats file.

Webpack Bundle Analyzer saved report to /.next/analyze/server.html
error - ../../node_modules/next/dist/client/dev/amp-dev.js
SyntaxError: Unexpected token / in JSON at position 525
    at JSON.parse (<anonymous>)

Building (none dev) gives the following error:

Failed to compile.

../../node_modules/next/dist/client/next.js
SyntaxError: Unexpected token / in JSON at position 525
    at JSON.parse (<anonymous>)


> Build error occurred
Error: > Build failed because of webpack errors
    at /node_modules/next/dist/build/index.js:15:924
    at async Span.traceAsyncFn (/node_modules/next/dist/telemetry/trace/trace.js:6:584)

Expected Behavior

Dev & build not to fail

To Reproduce

running this command from package.json (which had no issues in v10*):
cross-env NODE_ENV=development NODE_OPTIONS='--inspect --max_old_space_size=8192' next dev

@wroughtec wroughtec added the bug Issue was opened via the bug report template. label Jun 16, 2021
@wroughtec
Copy link
Author

wroughtec commented Jun 16, 2021

Ok seems to be linked to:
#26163
As had some comments in there (again next 10 had no issues)
When comments removed dev worked, however build failed as complained about

logo.svg
TypeError: unsupported file type: undefined (file: undefined)

@timneutkens timneutkens added please add a complete reproduction The issue lacks information for further investigation and removed bug Issue was opened via the bug report template. labels Jun 16, 2021
@MaximeBernard
Copy link

Might be a duplicate of #26132

@fitfab
Copy link

fitfab commented Jun 16, 2021

it also happens to me on my mac:
macOS Mojave
Version: 10.14.3

Screen Shot 2021-06-16 at 10 05 03 AM

IMPORTANT! -- I take this back the issue I had was with my eslint plugins conflicting with eslint-config-next
.

@recurser
Copy link

recurser commented Jun 16, 2021

Edit: it appears my issue is #26130

I just upgraded to v11, and have a similar issue loading SVGs. No problems on v10:

Screen Shot 2021-06-16 at 23 40 11

I don't have any comments or commas in .babelrc as described by @wroughtec, in case that's relevant.

@gu-stav
Copy link

gu-stav commented Jun 16, 2021

Also a duplicate of #25950

Can you disable the new static image feature for now as a workaround:

// next.config.js

module.exports = {
  images: {
    disableStaticImages: true
  }
}

@wroughtec
Copy link
Author

Hi yes that seems to have resolved my production build issues. Obviously not a long term solution as would be good to take advantage of the static image features but unblocks me for now

@gu-stav
Copy link

gu-stav commented Jun 17, 2021

@wroughtec I agree. There is some ongoing discussion about this here: #26167

@advaiyalad
Copy link

I (think) that this has been solved in the latest canary, 11.0.0-canary.4, by #26281. Could someone confirm (after removing disableStaticImages)?

@wroughtec
Copy link
Author

Yep that seems to resolve the build 👍

@timneutkens
Copy link
Member

There's 2 separate reports in this thread, both of them have been fixed on canary so I'm going to close this issue 👍

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
please add a complete reproduction The issue lacks information for further investigation
Projects
None yet
Development

No branches or pull requests

8 participants