Closed fals closed 7 years ago
Are you using angular-cli
with this repo, like to serve the application?
@mcescalante I'm using the exactly same stuff you are. I just cloned your branch to start my project, and any change you made or any issue I have with webpack I just come here to check out the solution. This issue started yesterday, with a clean npm install
@mcescalante As I said, the issue is related to extract-text-webpack-plugin, but when I fix out some version other error occur.
@fals these warnings have to do with a vocabulary change needed in webpack.config.js for webpack 2; loader
and fallbackLoader
are replaced with use
and fallback
I don't have time to open the PR now but I fixed these warnings this locally with a fresh clone. Here is a gist of the webpack config if you need to get rid of these warnings right away: https://gist.github.com/mcescalante/703997f94ebbe4585d1bf2d0016f1054
I will open a PR for this when I finish meetings today.
@mcescalante This solve the fallbackLoader
, but now every css file fails to load.
Good catch @fals, I'm in a meeting so that gist was half-baked. I'll finish this solution and comment again when I have it today. For now, you should be fine with what's here and just live with some warnings :)
@fals I just updated the gist (URL is the same, https://gist.github.com/mcescalante/703997f94ebbe4585d1bf2d0016f1054) and I believe it is working. Can you give this one a shot for me?
@mcescalante Same as before. Every component that imports any kind of css
fails. It's frustrating, I already tried early this solution that by my self, but I tried yours again to checkout if I missed something.
This looks like an error being thrown from your own custom component code. If you try my updated config in a fresh clone with no custom components, it seems to be working fine.
About your error, it looks like you may have written your component incorrectly; you do not need require()
there and to use a external template file you want templateUrl
not template
. You also want styleUrls
and not styles
. See this standard component definition:
@Component({
selector: 'my-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
If you "mock" the structure & files for home & about components in this repo, everything should work fine. I am in the gitter for this project right now if you prefer to ask me questions there.
@mcescalante You are wrong, the code I posted is from the Chrome, my code is like yours.
It's frustrating, someone changed something in the last 24 hours that broke webpack for those that are using your branch as base to their projects. I have 5 developers in stand by right now because of this error.
I will take a peak. I should definitely update to latest versions. I Will take a peek tomorrow, hands full for today (well, 22:20 in here :P)
@Foxandxss After replace my entire package.json and webpack.config.js for yours, I have a template loading issue, due zone.js
replace with mine? I thought your project was using mine to start with heh.
@Foxandxss e @mcescalante
I found the issue that is related to an newer package version of angular2-template-loader 0.6.1.
you should set the absolute version at the package.json to avoid this issue:
"angular2-template-loader": "0.6.0"
This should be fixed now via updates since this issue was opened - I just did a fresh clone and install/run to confirm. If you are still seeing this output with an updated copy or fresh clone, just comment.
Some package is causing this issue, but I can't figure out which one. I'm using a configuration just similar to yours:
package.json
Issue
I found this https://github.com/angular/angular-cli/pull/4435, but has nothing to do with webpack.
Also notice that the issue is the extract-text-webpack-plugin that changed something at configuration, then I tried to fix an older version, but got other kinds of errors due other packages, to be more precisely, 404 Resource not found listing all my component.html files .