Next 13 - When running turbo, scss stylesheets are not loaded
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Enterprise
Binaries:
Node: 16.14.2
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.0.2-canary.0
eslint-config-next: 13.0.1
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
No response
Describe the Bug
Scss modules do not appear to be loading under the new turbo
The style import always returns undefined.
Expected Behavior
Style is loaded and the red background css is present on the div.test element.
Link to reproduction
used npx-create-next-app
To Reproduce
When creating a new project from following command:
npx create-next-app@latest --experimental-app
And updating dev script to inlclude the turbo flag
"dev": "next dev --turbo",
Also loaded npm package “sass” as per instruction
When creating a very basic scss file: (./test.module.scss) in the app directory
.test { background-color: red; }
And creating an page.js file in app directory ` import styles from ‘./test.module.scss’;
const Home = () => {
return (
<div className={styles.test}>
test
</div>
);
};
export default Home; `
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Basic Features: Built-in CSS Support - Next.js
Next.js supports including CSS files as Global CSS or CSS Modules, using `styled-jsx` for CSS-in-JS, or any other CSS-in-JS solution! Learn more here....
Read more >Css not loading in production mode when using nextjs
Ok, I just deleted the .next folder prior to building the production version via npm run build and after that, everything worked.
Read more >Encore: Setting up your Project (Symfony Docs)
Using Sass /LESS/Stylus; Compiling Only a CSS File; Keep Going! ... The key part is addEntry() : this tells Encore to load the...
Read more >Install Tailwind CSS with Next.js
Using Turbopack. The quickest way to start using Tailwind CSS in your Next.js project is to use the Next.js + Tailwind CSS Example....
Read more >What's New in Next.js 13 - AppSignal Blog
It supports Server Components, TypeScript, JSX, CSS, and more. As the project is in alpha state, many of the features are not yet...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It does not even work without turbo. No styles are applied whatsoever when navigating between pages. Guess css modules are just broken. Regular css files get applied, like global.scss Always have to reload the page for styles to be applied
Hey, Jordan from the Tailwind Labs team here. We’ve done some investgating of this issue ourselves and want to share our findings:
postcss-import
plugin, Sass/SCSS imports, and likely other tools as well.I’ve created a minimal reproduction with Tailwind CSS that you can take a look at.