question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ring-ui webpack css error

See original GitHub issue

I’m trying to use ring-ui header (I have of course added the config block to a js file in the webpack.config.d folder) First I encountered an error complaining that core-js can’t be found. I added the dependency through gradle

implementation(npm("core-js", "3.16.2"))

Now I’m seeing the error below. I searched a bit and found this question but don’t know how to fix it.


Error:

Module build failed (from ../../node_modules/css-loader/dist/cjs.js):
CssSyntaxError

(2:7) /.../build/js/node_modules/@jetbrains/ring-ui/components/alert/alert.css Unknown word

  1 | 
> 2 |       var API = require("!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
    |       ^
  3 |       var domAPI = require("!../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
  4 |       var insertFn = require("!../../node_modules/style-loader/dist/runtime/insertBySelector.js");



Error:

Module build failed (from ../../node_modules/css-loader/dist/cjs.js):
CssSyntaxError

(2:7) /.../build/js/node_modules/@jetbrains/ring-ui/components/alert/container.css Unknown word

  1 | 
> 2 |       var API = require("!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
    |       ^
  3 |       var domAPI = require("!../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
  4 |       var insertFn = require("!../../node_modules/style-loader/dist/runtime/insertBySelector.js");



Error:

Module build failed (from ../../node_modules/css-loader/dist/cjs.js):
CssSyntaxError

(2:7) /.../build/js/node_modules/@jetbrains/ring-ui/components/auth/down-notification.css Unknown word

  1 | 
> 2 |       var API = require("!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
    |       ^
  3 |       var domAPI = require("!../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
  4 |       var insertFn = require("!../../node_modules/style-loader/dist/runtime/insertBySelector.js");

p.s I have applied the WA for this issue so maybe a webpack 4.0.0 compatiblity issue?

afterEvaluate {
    rootProject.extensions.configure<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension> {
        versions.webpackDevServer.version = "4.0.0"
    }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Neitexcommented, Aug 24, 2021

I’ve had this problem in past. For me, disabling cssSupport at build.gradle.kts helped:

browser {
            // ...
            commonWebpackConfig {
                cssSupport.enabled = false
            }
            // ...
        }

I don’t fully understand why, but it works 😃

0reactions
turanskycommented, Aug 26, 2021

Please consider adding it to readme

It can be done by any developer with GitHub account! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack Error when trying to pack CSS · Issue #1648 - GitHub
I have to include statically a library (cesium) which does not support RequireJS. I have managed to get webpack to package this file...
Read more >
webpack resolve error with packaged css file referencing an ...
I'm working on a Vue component library built via VueCLI (and using Storybook Js, Bulma, and Buefy) and I am having issues consuming...
Read more >
ring-ui-welcome--changelog - GitHub Pages
If you used the following line in your webpack config to reduce the bundle ... If your project imports Ring UI's SCSS files,...
Read more >
sass-loader - webpack - JS.ORG
Loads a Sass/SCSS file and compiles it to CSS. Getting Started. To begin, you'll need to install sass-loader : npm install sass- ...
Read more >
How to configure CSS and CSS modules in webpack
How to configure basic CSS in a webpack project using style-loader and css- ... If you wouldn't have configured css-loader you would get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found