vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.28k stars 26.49k forks source link

Next.js 14 build hangs forever with ace-code-editorjs while it works fine with Next.Js 13 #58382

Open ats1999 opened 9 months ago

ats1999 commented 9 months ago

Link to the code that reproduces this issue

https://github.com/ats1999/nextjs-14-build-hangs

To Reproduce

  1. git clone https://github.com/ats1999/nextjs-14-build-hangs.git
  2. cd nextjs-14-build-hangs
  3. npm i
  4. npm run build

You'll get to see that nextjs build will hang forever.

Current vs. Expected behavior

Currently, i am expecting that it should build nextjs but it is hanging forever.

Verify canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103
Binaries:
  Node: 18.16.1
  npm: 9.5.1
  Yarn: N/A
  pnpm: 8.6.5
Relevant Packages:
  next: 14.0.2
  eslint-config-next: 14.0.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Additional context

The build is hanging with the next 14.0.2 and upper versions but it's working fine with 13.x.x.

I haven’t checked all versions, but the above two versions have been checked.

The build is hanging on the local machine as well as vercel deployment

Although, npm run dev is working fine.

You can just remove <Editor id="editor" /> from app/page.tsx and the build will work fine.

Why is this happening? This is not happening while local development, but occurs only when i am running npm run build

ats1999 commented 9 months ago

Why i can’t see any error on the terminal? Is there any infinite loop?

ats1999 commented 9 months ago

@jw-vercel any update

fandyajpo commented 9 months ago

i face this issue, my nextjs app stuck in

Linting and checking validity of types ...

and stuck around 45m in vercel then return error build with no reason

nextjs 14, pages dir

llamerr commented 8 months ago

Same here, either running lint or build stucks, ctrl+c not working, need to send SIGKILL to stop it

I'm using https://github.com/ixartz/Next-js-Boilerplate as a starter, but seems it's not the issue for this problem

Trying to find the reason, so far it seems it's not nextjs issue, but eslint issue. Code goes inside eslint module, and getting stuck there, not returning back.

So, there's eslint/lib/cli-engine, which has function verifyText In my case it's getting stuck on /storybook-static/350.67e726ff.iframe.bundle.js file, not yet sure why.

I'm not sure where that linter.verifyAndFix coming from and don't really care, adding storybook-static to .eslintignore solved this problem for me. Try adding some console.logs to that file and check what's blocking it on your side and maybe ignore it too, if it's some file that don't need linting.

btw, ats1999 in your case I can't replicate the problem anymore, it builds with an error for me

techbeeyt commented 5 months ago

Facing the same issue. But it works occasionally. First time fixed it by naming all the page function names as Page().

ahadsts9901 commented 3 months ago

Faced same issue, I push my code and deploy it on vercel, my build was successfull after 1 hour