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.

TypeScript template results in extract-text-webpack-plugin error

See original GitHub issue

The default typescript template generates a project that fails to build.

Environment

  1. react-static --version: 5.9.8
  2. node -v: v8.11.3
  3. yarn --version: 1.9.4
  4. Operating system: macOS High Sierra

Steps to Reproduce the problem

  1. react-static create -n my-static-site -t typescript
  2. cd my-static-site
  3. yarn build

Result:

Error: Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-  text-webpack-plugin for the usage example

Expected Behavior

Expect the generated project to build successfully.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
johotcommented, Oct 7, 2018

Follow up:

I actually managed to do a temporary fix, i replaced defaultLoaders.cssLoader in static.config.js with:

const ExtractTextPlugin = require("extract-text-webpack-plugin");
...
//defaultLoaders.cssLoader,
          {
            test: /\.css$/,
            use: ExtractTextPlugin.extract({
              fallback: "style-loader",
              use: "css-loader"
            })
          },
...
 config.plugins = [new ExtractTextPlugin("styles.css")];

But it feels like defaultLoaders.cssLoader should handle this right?

1reaction
tannerlinsleycommented, Dec 21, 2018

Yeah, I think that’s the best option. The plugin will offer a lot more flexibility than an example that will get outdated. Let’s track any issues with the plugin there from here on out: https://gitlab.com/Vinnl/react-static-plugin-typescript

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 5 Error: "extract-text-webpack-plugin" loader is used ...
I have this error when compiling. ERROR in ./src/app/app.component.css Module build failed: Error: "extract-text-webpack-plugin" loader is used ...
Read more >
ERROR in ./node_modules/css-loader!./node_modules/sass ...
My code works perfectly in dev environment when I try npm run build I get the following error: ERROR in ./node_modules/css-loader!
Read more >
MiniCssExtractPlugin - webpack
This plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS...
Read more >
fork-ts-checker-webpack-plugin - npm
Runs typescript type checker and linter on separate process. ... watching many files can result in a lot of CPU or memory usage ......
Read more >
Solution - "extract-text-webpack-plugin" loader is used without ...
Recurring problem in Webpack's extract-text-webpack-plugin package, ... and using underscore-template-loader as part of a template definition.
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