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.

Cannot import css files in javascript

See original GitHub issue

I’m submitting a bug report

  • Library Version: 0.17.0
  • Operating System: OSX 10.11.6
  • Node Version: 6.2.0
  • NPM Version: 3.8.9
  • Browser: all
  • Language: ESNext

Current behavior: I want to import a css file in src/main.js so I write:

import mycss from './mycss.css!text';

But when I au run I have the following error : “{ Error: ENOENT: no such file or directory, open ‘…/src/mycss.css.js’”

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
hadrienlcommented, Aug 18, 2016

It’s sad it’s not the same syntax like jspm and webpack… it will be complicate if someday we have to switch to webpack for exemple 😦

0reactions
EisenbergEffectcommented, Oct 22, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cant Import CSS files into React Project - Stack Overflow
js i get following error. i dont know how to resolve it. ERROR in ./node_modules/css-loader!./src/index.
Read more >
Solving the React Error: Not Picking Up CSS Style | Pluralsight
This error is generated because the compiler is only able to import files from the src folder. Here, the CSS file is saved...
Read more >
External js libraries' css files can't be imported #10522 - GitHub
I have imported react-toastify and when I import it's css file (import ... External js libraries' css files can't be imported #10522.
Read more >
How to import CSS in React.js component? - DEV Community ‍ ‍
We can import the sass file into our files by using a relative import path. With that method, we can create a directory...
Read more >
[Solved]-Cant Import CSS files into React Project-Reactjs
[Solved]-Cant Import CSS files into React Project-Reactjs. Search. score:3. Accepted answer. module: { rules: [ { test: /\.(js|jsx)$/, exclude: ...
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