529 questions
1
vote
0
answers
42
views
Webpack changes URLs in CSS during build: how to keep original relative paths in url()
I have a CSS file with a @font-face declaration where font paths are specified as url("./icons/tficons.woff2"). However, when building with Webpack, these paths get rewritten to url(../tflex-...
0
votes
0
answers
30
views
CSS modules - no properties in styles object
I have css-loader version 7.1.2 and according to their release notes, I have to structure my code as such:
In my component, I imported the style:
import * as styles from './mycomponent.module.less'
I ...
0
votes
0
answers
5
views
React-md package import bug in scss
I have a big project that uses ChartIQ.
In the past, we used react-scripts start for run the project
Now we are using react-app-rewired start for run with the ChartIQ implementation.
It's not a main ...
1
vote
2
answers
190
views
Webpack not recognizing css-loader despite it being in config
for some reason webpack is not recognizing css-loader, despite it being in the config and being installed. Here is my webpack.config.json
const path = require('path')
module.exports = {
entry: './...
0
votes
0
answers
48
views
CSS modules is undefined while importing into react component
I am building a chrome extension utilizing react, webpack, tailwindcss and css modules.
But, when I try to import css modules into my react component, it turns out to be undefined.
src/InjectedPopup/...
1
vote
0
answers
59
views
How to get url path for CSS at runtime?
I use CSS Modules.
I don't need resolving of url, but I need replace url paths with my custom function call so that I could get the full url at runtime by myself with my custom logic.
For example,
&...
2
votes
2
answers
740
views
style-loader does not recoginize default imports of CSS modules in storybooks
I am setting up UI Storybooks with its newer version of 8.1.4 but could not get the style-loader and css-loader to work in a compatible way such that CSS modules can be properly loaded into the canvas ...
1
vote
1
answer
653
views
I don't know how to configure the latest version of css-loader
Using the latest version of css-loader with Webpack 5.91.0, the imported CSS modules are always undefined when enabling cssModules. (This issue was resolved by downgrading css-loader to version 5.0.0.)...
0
votes
2
answers
429
views
Webpack: stop css-loader from replacing svg urls with hashed svgs
I realized that my project at some point stopped showing svgs which I link from my scss files.
I have lines like:
background-image: url('./assets/icons/check-icon.svg');
Webpack, I suspect it's the ...
0
votes
1
answer
662
views
Webpack 5 - Error: Module parse failed: Unexpected character '@'
I am attempting to load some .scss files in webpack 5 and then output them as .css files.
I have setup my config to take only .scss files as entries and use MiniCssExtractPlugin, css-loader, resolve-...
1
vote
0
answers
226
views
Unexpected character '@' (1:0): @charset "UTF-8"
After upgrading Angular from version 11 to 17, I'm encountering the following error:
File was processed with these loaders:
* ./node_modules/resolve-url-loader/index.js
* ./node_modules/sass-loader/...
0
votes
1
answer
100
views
"Import * as" not working after upgraing some css related loaders
I upgraded the following packages to their latest versions:
package name
current version in project
upgraded version(latest version)
mini-css-extract-plugin
0.8.2
2.8.0
postcss-browser-reporter
0.5.0
...
1
vote
1
answer
686
views
Export errors while exporting CSS using Webpack v5
WARNING in ./src/components/desktop/layout/AutoAuth.js 48:12-21
export 'layerHide' (imported as 'layerHide') was not found in '../../../css/layout.css' (possible exports: default)
@ ./src/components/...
1
vote
1
answer
510
views
How can I modify the insert method for Webpack style-loader?
The default behaviour of Webpack style-loader is to inject a style tag as the last child of the head tag. However, I want to modify the default insert method so that the css is injected into a shadow-...
0
votes
0
answers
51
views
Webpack CSS class non applied to HTML elements and React components
I set up a project with Webpack, Lit2 and React.
I have a problem with CSS Stylesheet and React components. I created a stylesheet 'homesheet.module.css' and imported in my React component.
import ...
0
votes
1
answer
28
views
Webpack can't seem to load css
I am trying to create a npm package for a single .tsx component however When I run wepback I keep getting this error:
ERROR in ./src/Chatbot.tsx 184:20
Module parse failed: Unexpected token (184:20)
...
4
votes
4
answers
9k
views
NextJS - TypeError: Cannot read properties of null (reading 'removeChild') when saving SASS file
I'm getting an error as such:
Unhandled Runtime Error
TypeError: Cannot read properties of null (reading 'removeChild')
Call Stack
HTMLLinkElement.eval
node_modules/next/dist/compiled/mini-css-...
0
votes
1
answer
252
views
Preact change webpack css loader config
I'd like to change the webpack config on Preact to have only hashed class names, and make them shorter as well if it's a safe practice.
The css loader works fine on my preact project but sometimes the ...
1
vote
1
answer
1k
views
How to specify multiple webpack output directories
I have a large django project, with multiple apps, and each application has its own static directory like this /[appname]/static/[appname]/[css, js, or img directory].
I have multiple entrypoints ...
0
votes
0
answers
540
views
Next.js css-loader module classnames do not match between html and css
I'am using tailwind css for my css framework, and I'am trying to Hash my tailwind css class using webpack css-loader, the css classes is completed to hash, but the html class is still showing the ...
0
votes
1
answer
754
views
webpack style loader and css loader not working for simple example
I attempting to follow the tutorial here https://webpack.js.org/guides/asset-management/ however I can never get the css file to load. (the text is never red)
I have tried all available solution which ...
1
vote
1
answer
465
views
How to exclude creation of css chunk files?
I have a project in which I have to build all the modules into one file, and also split it into modules.
But I don't need css files for modules except for one common.
My files:
file 'a.js'
import 'a....
3
votes
0
answers
400
views
Webpack style-loader and css-loader not working on a simple project
I am having an issue on a simple project, after configuring webpack.config.js
const HTMLPlugin = require('html-webpack-plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const ...
1
vote
0
answers
292
views
Webpack css loader issue while making server side rendering- React
I made an SSR project with basic requirements everything was fine until I used CSS in my project for styling but I got an error that the loader is not there for understanding CSS so I modified my ...
1
vote
1
answer
2k
views
Webpack 5 and css-loader aren't compiling @value directive from CSS Modules
We have a React app with Webpack 5. There are some .scss files that are importing values from a component library installed in node_modules using the @value directive from CSS Modules. Everything was ...