SCSS/CSS not being generated
See original GitHub issue❓Question
I’m facing a couple issues with SCSS while upgrading from v3 to v4, and I’m looking for some help! My project uses SCSS modules, loadable components, Tailwind, and Typescript plugins for Razzle. I use the simplified const style = require('./style.scss');
method of importing styles.
- The generated server html does not contain any style links, nor does the asset.json file have .css files shown. Specifically this means that
assets.client.css
is blank. (This is also the case with thewith-scss
project in the Razzle examples folder) - HTML class names in both client and server apps are output as “undefined”. For example a container div element is output as
<div class="undefined undefined">...</div>
- The
<style>
tags and all styles do render in the client app html, but they no longer have unique local identifier names like.style_home_containter__d38f3ls
, they are just named.container
My razzle config is simple:
const SCSSPlugin = require('./packages/razzle/razzle-plugin-scss');
const LoadablePlugin = require('./packages/razzle/razzle-plugin-loadable');
module.exports = {
plugins: [SCSSPlugin, LoadablePlugin, 'typescript'],
};
The custom scss plugin is a copy of Razzle’s scss package, with Tailwind prepended to the plugins array for postcss config.
LoadablePlugin is a copy of Razzle’s example config.
Any help is greatly appreciated.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top Results From Across the Web
VIsual Studio Code - Live Sass Compiler Not Generating .css ...
I have tried setting the savePath to "/css" - After this - I tried saving my main.scss file, which is supposed to generate...
Read more >css file not being generated · Issue #13 - GitHub
Everything seems to be working but a css file is not generated. Created a 'vscode' folder in the project root directory with a...
Read more >Generated CSS files are not placed under SCSS, as before
Thus, seems CSS files are generated by some other tool, not SCSS File Watcher. To verify this, you can disable SCSS File Watcher,...
Read more >How to Use Sass with CSS - freeCodeCamp
To do this, the compiler will generate a file with the CSS code. This transformation is called compilation.
Read more >Sass Compiler NOT Working in Visual Studio Code - YouTube
In this tutorial I am going to explain how to fix the visual studio code live sass compiler extension if it is not...
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 FreeTop 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
Top GitHub Comments
I’ve found the source of
undefined
problem. I was usingconst style = require('./style.module.scss');
to import styles, as this was how I set the app up many moons ago. I switched those imports toimport style from './style.module.scss'
and voila! Typescript, Tailwind, SCSS, and loadable components all playing nicely together in Razzle.Great if you figure it out 😀