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.

Having issues using CSS

See original GitHub issue

I’ve read the other issues submitted here, but I can’t get CSS to load.

In an component, I do something like:

import s from 'rc-dropdown/assets/index.css';
...
export default withStyles(Dropdown, s);

However I get the error: SyntaxError: Unexpected token ILLEGAL

I’ve tried modifying the webpack config to both:

      {
        test: /\.css$/,
        loaders: [
          'isomorphic-style-loader',
          `css-loader?${DEBUG ? 'sourceMap&' : 'minimize&'}modules&localIdentName=` +
          `${DEBUG ? '[name]_[local]_[hash:base64:3]' : '[hash:base64:4]'}`
        ]
      },

and

{
        test: /\.scss$|.css$/,
        loaders: [
          'isomorphic-style-loader',
          `css-loader?${JSON.stringify({
            sourceMap: DEBUG,

            // CSS Modules https://github.com/css-modules/css-modules
            modules: true,
            localIdentName: DEBUG ? '[name]_[local]_[hash:base64:3]' : '[hash:base64:4]',

            // CSS Nano http://cssnano.co/options/
            minimize: !DEBUG,
          })}`,
          'postcss-loader?parser=postcss-scss',
          'sass-loader?sourceMap',
        ],
      },

Still getting the same error - what am I supposed to do?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Ehespcommented, Mar 22, 2016

Okay cheers - not too keen on that approach since I’ve got quite a few external components. Will stick with the inline approach, thanks!

0reactions
SerjoPeppercommented, Jul 26, 2016

Not work for me too

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling common HTML and CSS problems - MDN Web Docs
Some problems can be solved by just taking advantage of the natural way in which HTML/CSS work. Unrecognized HTML elements are treated by...
Read more >
Common CSS Issues For Front-End Projects
Common CSS Issues For Front-End Projects · 1. Reset The Backgrounds Of button And input Elements · 2. Overflow: scroll vs. · 3....
Read more >
How to Troubleshoot CSS Not Working - WPForms
Have you added custom CSS for your forms, but not been able to see it come through? Here's how to troubleshoot when your...
Read more >
Solving problems with CSS - Hidde's blog
CSS problems are often solved with clever combinations of CSS properties. Putting these in a black box can make complex things look simple,...
Read more >
Problems of CSS at Scale - byby.dev
Lacking of built-in namespaces - Any programming languages lacking built-in namespaces will have problems at scale and CSS is obviously one of ......
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