Thanks to visit codestin.com
Credit goes to github.com

Skip to content

next v15 with turbo causes "params should be awaited" error without params usage but with icon.svg file and slug in root path in app router #74918

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

Open
Cielquan opened this issue Jan 15, 2025 · 5 comments
Labels
Internationalization (i18n) Related to Internationalization with Next.js. Turbopack Related to Turbopack with Next.js.

Comments

@Cielquan
Copy link
Contributor

Link to the code that reproduces this issue

https://github.com/Cielquan/nextjs-params-async-turbo-issue

To Reproduce

  1. Clone repo
  2. Install dependencies e.g. pnpm i
  3. Run the dev script e.g. pnpm dev
  4. Goto http://localhost:3000/de-DE/app and see icon in tab and no error in console
  5. Stop dev script
  6. Run dev script with --turbo e.g. pnpm dev --turbo
  7. Goto http://localhost:3000/de-DE/app and see icon in tab and now error in console:
    Error: Route "/[locale]/app" used `params.locale`. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
        at tree.children.children.metadata.icon (.next/server/chunks/ssr/c488b_next_dist_esm_build_templates_app-page_3dcdb1.js:71:376)
        at Array.map (<anonymous>)
    
  8. Delete src/app/[locale]/app/icon.svg file
  9. Goto http://localhost:3000/de-DE/app and see icon in tab and no error in console

Current vs. Expected behavior

Current

icon.svg somehow causes an error where params.locale is used but not awaited, even so my code does not use params at all anywhere.

Expected

icon.svg should not causes the error.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov  6 17:42:15 UTC 2
  Available memory (MB): 15994
  Available CPU cores: 4
Binaries:
  Node: 20.12.1
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 9.11.0
Relevant Packages:
  next: 15.1.4 // Latest available version is detected (15.1.4).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: N/A

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

Turbopack, Internationalization (i18n)

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

next dev (local)

Additional context

No response

@Cielquan Cielquan added the bug Issue was opened via the bug report template. label Jan 15, 2025
@github-actions github-actions bot added Internationalization (i18n) Related to Internationalization with Next.js. Turbopack Related to Turbopack with Next.js. labels Jan 15, 2025
@coderrshyam
Copy link

the error params should be awaited because in next.js15 params are now promises which must to be awaited

@Cielquan Cielquan changed the title next v15 with turbo causes "params should be awaited" error with icon.svg file and slug in root path in app router next v15 with turbo causes "params should be awaited" error without params usage but with icon.svg file and slug in root path in app router Jan 15, 2025
@Cielquan
Copy link
Contributor Author

Yeah, I know. And in my big application I ran the codemod and stuff. And checked all usage of params if they are awaited and they are.

If you take a look at the minimal repro I came out with (linked in OP) you will see, that it does not even use params. (I edited that part into the title) And the more peculiar thing is that the icon.svg file seems to be the culprit and it only errors with turbopack.

@samcx samcx removed the bug Issue was opened via the bug report template. label Jan 16, 2025
@ParwarYasinQadr

This comment has been minimized.

@ohueter
Copy link

ohueter commented Mar 23, 2025

I experienced the same issue using Nextjs 15.1.0 with twitter-image.jpg and opengraph-image.jpg placed in a dynamic route subfolder. It could be resolved by deleting the images. However, it doesn't occur after updating to v15.2.3, so it's likely already fixed in the latest version 👍

@timneutkens
Copy link
Member

Going to close this issue based on @ohueter's comment. If you're still running into issues let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Related to Internationalization with Next.js. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

6 participants