-
Notifications
You must be signed in to change notification settings - Fork 28k
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
incorrect warning: "loading" is ignored by next/dynamic because you have enabled "suspense". #40388
Comments
I can repro this issue. Ig it's causing because of https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/dynamic.tsx#L70 |
I am sorry that my previous PR is causing the issue. I am working on a fix now. |
…uspense (#40397) The PR fixes #40388. Currently, `next/dynamic` will try to provide a default `loading` to the `loadableOptions` even when `suspense` is enabled, thus triggering the incorrect warning. The PR fixes that. The corresponding integration test case is also updated. cc @huozhi ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` Co-authored-by: huozhi <inbox@huozhi.im>
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
λ npx --no-install next info
warn - Latest canary version not detected, detected: "12.3.0", newest: "12.3.1-canary.0".
Please try the latest canary version (
npm install next@canary
) to confirm the issue still exists before creating a new issue.Read more - https://nextjs.org/docs/messages/opening-an-issue
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
getting the error incorrectly:
"loading" is ignored by next/dynamic because you have enabled "suspense". Place your loading element in your suspense boundary's "fallback" prop instead. Read more: https://nextjs.org/docs/messages/invalid-dynamic-suspense"
where my suspense usage is:
According to https://nextjs.org/docs/messages/invalid-dynamic-suspense:
When I add loading: undefined, the error is gone.
I think the offending PR is this: #39676
Expected Behavior
should not be generate a warning with this usage:
Link to reproduction
n/a
To Reproduce
The text was updated successfully, but these errors were encountered: