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.

[next branch] requiring css that imports another assets causes runtime error

See original GitHub issue

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

haven’t tried it yet, but it works on the same env, same code, but v1 react-scripts

Which terms did you search for in User Guide?

N/A

Environment

Environment: OS: macOS High Sierra 10.13.2 Node: 8.9.4 Yarn: 1.3.2 npm: 5.6.0 Watchman: Not Found

Packages: (wanted => installed) react: ^16.2.0 => 16.2.0 react-dom: ^16.2.0 => 16.2.0 react-scripts: 2.0.0-next.096703ab => 2.0.0-next.096703ab

Browser: Chrome Version 63.0.3239.132 (Official Build) (64-bit)

Steps to Reproduce

  1. create new app
  2. yarn add react-slick
  3. import 'slick-carousel/slick/slick-theme.css' or require('slick-carousel/slick/slick-theme.css'); in index.css

Expected Behavior

No runtime error

Actual Behavior

A runtime error screen shot 2018-01-18 at 11 00 58

Reproducible Demo

https://github.com/viankakrisna/create-react-app-example/blob/master/src/index.js

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Jan 29, 2018
0reactions
jihchicommented, Jan 29, 2018

Hi,

I’ve same issue with react-scripts@2.0.0-next.9754a231. Both regular css and css module have same result.

regular css

body {
  background-image: url('./logo.svg');
  ...
}

screenshot_2018-01-29_18-03-14_bo9qv 1

css module

.bg-svg {
  background-image: url('./logo.svg');
}

screenshot_2018-01-29_18-03-42_7raii 1

Here is the reproducible code: https://github.com/jihchi/create-react-app-3852

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing CSS files in Isomorphic React Components
Short answer: It's a node runtime error. Trying to load CSS on the server in isomorphic apps is not a good idea. javascript...
Read more >
How to Solve the Chunk Load Error in JavaScript - Rollbar
Whenever there's an error observed in dynamically fetching helper JavaScript files known as Chunks, a ChunkLoad Error is thrown.
Read more >
Solving the React Error: Not Picking Up CSS Style | Pluralsight
In this guide, you will learn about the errors that can occur while importing a CSS file into your React file.
Read more >
Caching - webpack
Running our build script, npm run build , with this configuration should produce the following output: ... Asset Size Chunks Chunk Names main....
Read more >
The Asset Pipeline - Rails Edge Guides
It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass, and ERB. It allows assets...
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