New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot import extract-text-webpack-plugin #164
Comments
Odd. Can you try upgrading to Node 5.11.1 and report back? Others on
|
UPDATE: The problem is not restricted to the plugin - IMHO it has to do with ES6- |
@coryhouse: Okay, I'll update node. |
@coryhouse: Updated node to v6.2.1, but the issue still exists. However, I found the problem (which should not be a problem anyway): I'm working with a mapped drive "V" where my project is located at the root ("V:"). When running npm from "V:", the build fails when including the webpack plugin. When I switch to the actual drive and path ("D:\Projects\ReactRedux"), it works! Seems that node has either a problem with mapped drives ("subst" command in windows) or with projects located at the root of a drive. What I still did not get to work is the issue I filed here: http://stackoverflow.com/questions/37833128/webpack-import-not-working-whereas-require-works-okay. Aliasing pathes with webpack does not work when using "ES6-import" (but works with "require"). |
@peter-perot Thanks for the update. I'm currently stumped on why import isn't working for you on extract-text-webpack-plugin. You're the first to report this, and this code has had heavy usage for months. Might try installing Node 5.11.1 just to see if anything changes. |
Issue solved. It was ESLint. Solution:When you are using aliases in webpack like this resolve: {
root: path.resolve(__dirname),
alias: {
"~": "src"
},
extensions: ["", ".js", ".jsx"]
} and you are importing this way import { ServiceStub } from "~/services/service-stub"; ESLint cannot resolve the alias and reports an error. To get it work you must tell ESLint to ignore some rule with @coryhouse, if you know how to configure ESLint to resolve those aliases - feel free to improve my solution. |
So why are you using ~ in your paths? Why not specify relative paths as I do throughout the example app? |
Your virginal boilerplate code works okay now. But I used it to start some larger project. There I have some library source code modules which are located at So I read about webpack aliases to avoid chains of Just a personal preference. |
Ah, gotcha. Thanks for clarifying. |
Node version: 4.4.4
npm version: 3.9.5
Operating system: Windows 8.1
Command line used:
npm run build
When I'm running the above command I'm getting the follwing error:
There are two ways to solve this error:
1st solution:
2nd solution:
Why is the import syntax working with webpack, but not with the plugin?
The text was updated successfully, but these errors were encountered: