next.js: [v15] Module parse failed: Bad character escape sequence

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/condescending-haze-go8s7s

To Reproduce

  1. run this commad: npx create-next-app@latest
  2. This will install latest version of nextjs like in package.json is "dependencies": { "react": "19.0.0-rc-65a56d0e-20241020", "react-dom": "19.0.0-rc-65a56d0e-20241020", "next": "15.0.0" }, "devDependencies": { "typescript": "^5", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "postcss": "^8", "tailwindcss": "^3.4.1", "eslint": "^8", "eslint-config-next": "15.0.0" }
  3. npm run dev
  4. browser showing error `Module parse failed: Bad character escape sequence (11:57) | const fileSizeInMB = buffer.byteLength / 1024 / 1024

error `

Current vs. Expected behavior

I have just not changed any default value during app creation like shown in screenshot it should spin up dev server without error. which it dose but after within seconds error pop out. install

Provide environment information

test

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

create-next-app

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

next dev (local)

Additional context

When i step down to version 14 its working fine with 14.2.15 npx create-next-app@14 test-project

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 28 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Hey everyone, v15.0.2 is out with the fix. Please give it a try and lmk!

I deleted favicon.ico and it returned to normal operation.

This is also what “fixed” it for me. Should definitely not run into that error for having a favicon.ico file…

I deleted favicon.ico and it returned to normal operation.

npx rimraf .next and then running next server should be working.

@faisalrehmanlums Hi, #71673 hasn’t been added to the release yet, ~expected to be at 15.0.1-canary.4~.

Could you try v15.0.2-canary.0? Thank you!

I just tried this, not working.

@faisalrehmanlums Hi, https://github.com/vercel/next.js/pull/71673 hasn’t been added to the release yet, expected to be at 15.0.1-canary.4.

Could you try v15.0.2-canary.0? Thank you!

FYI, here is my development environment:

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 23855
  Available CPU cores: 12
Binaries:
  Node: 22.9.0
  npm: N/A
  Yarn: N/A
  pnpm: 9.12.0
Relevant Packages:
  next: 15.0.1 // Latest available version is detected (15.0.1).
  eslint-config-next: 14.2.13
  react: 19.0.0-rc-45804af1-20241021
  react-dom: 19.0.0-rc-45804af1-20241021
  typescript: 5.6.2
Next.js Config:
  output: N/A

next dev --turbo is working healthy but either next dev or next build throws the same error.

I have installed the canary version but still issue not resolved. Here is my package.json screenshot with error.

image

cmd is

image

Hey everyone, sorry for letting this slip. Feel free to ping me if 15.0.1-canary.2 did not fix it. When we can confirm, will have the patch ASAP to unblock your upgrade. Again, apologies for inconvenience and thank you all for your report. Thank you!

I think we should not inline the path into the string, or we should replace \ with \\ on windows. cc @devjiwonchoi