Verify canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103
Binaries:
Node: 18.11.0
npm: 8.19.2
Yarn: 1.22.10
pnpm: N/A
Relevant packages:
next: 13.0.2
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
Chrome, Safari
How are you deploying your application? (if relevant)
next dev
Describe the Bug
When using the experimental /app mode with the following setup, RSC seems to stream in a malformed script tag, causing a crash:
- Uses /app directory
- Root page has both a
layout.tsx and a loading.tsx
page.tsx exports an async server component
page.tsx uses a class name from a CSS module, styles.module.css


Unexpected string literal ",". Parse error.
See minimal repro in code here: mxmul/next13-async-component-css-modules-repro@c562d4d
Expected Behavior
Page should render the loading state immediately, then the loaded content.
e.g.

Link to reproduction
https://github.com/mxmul/next13-async-component-css-modules-repro
To Reproduce
Clone the repo, and run yarn dev.
The first time you load the page, it seems to render properly. You see a loading state, then the rendered page:

After refreshing the page, you should see next crash with a syntax error:

Verify canary release
Provide environment information
What browser are you using? (if relevant)
Chrome, Safari
How are you deploying your application? (if relevant)
next dev
Describe the Bug
When using the experimental /app mode with the following setup, RSC seems to stream in a malformed script tag, causing a crash:
layout.tsxand aloading.tsxpage.tsxexports an async server componentpage.tsxuses a class name from a CSS module,styles.module.cssUnexpected string literal ",". Parse error.See minimal repro in code here: mxmul/next13-async-component-css-modules-repro@c562d4d
Expected Behavior
Page should render the loading state immediately, then the loaded content.
e.g.

Link to reproduction
https://github.com/mxmul/next13-async-component-css-modules-repro
To Reproduce
Clone the repo, and run
yarn dev.The first time you load the page, it seems to render properly. You see a loading state, then the rendered page:
After refreshing the page, you should see next crash with a syntax error: