-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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 13 Using a Loading UI alongside an async Server Component with SCSS module generates a runtime syntax error (unexpected token: string literal) #42723
Comments
Encountered this bug tonight when pushed my app into production. I can confirm removing |
I'm also having this problem, when loading is used with async fetch data it reports an error |
Hey, I still have this issue with node 19 (I tried with 19.1, 19.3 and 19.4), and node 18.13 with next 13.1.2 . |
#49871 may have a similar root of problem . |
I'm still having this issue In v14.1.0 |
potentially a clue, this error only raises if a
|
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Firefox 106.0.5 (64-bit)
How are you deploying your application? (if relevant)
next dev
Describe the Bug
In
next dev
mode, when a scss module is imported and its styles are referenced in the rendering of anasync
server component, such asapp/page.tsx
, and at the same time there is anapp/loading.tsx
present, then a browser refresh will generate a syntax error (unexpected token: string literal) in the loaded HTML.The generated syntax error can be found in the final script tag of the page after a browser refresh in
next dev
mode:Expected Behavior
No syntax error to be generated and the page to load successfully.
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://github.com/JDBar/next13-async-sass-module-bug
To Reproduce
First I ran:
I then created an
async
server component in theapp
folder which also imported and referenced an scss module.app/page.module.scss
app/page.tsx
This works as expected when running
next dev
. Openinglocalhost:3000
loads successfully, and refreshing works.However, we can generate a syntax error at runtime after introducing one of the new instant loading states.
app/loading.tsx
Now, running
next dev
will work on initial page load, but generate a syntax error on page refresh.The text was updated successfully, but these errors were encountered: