Skip to content

fix(webpack): remove usage of fallbackLoader and loader #4435

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

Merged
merged 1 commit into from
Feb 6, 2017

Conversation

beeman
Copy link
Contributor

@beeman beeman commented Feb 4, 2017

Fixes #4434

@hansl
Copy link
Contributor

hansl commented Feb 5, 2017

Just to clarify; this is to fix a warning, correct? There's no need for an emergency release, right?

@beeman
Copy link
Contributor Author

beeman commented Feb 5, 2017

That's right @hansl, the apps work fine and the warning only appears once

@Splaktar Splaktar mentioned this pull request Feb 5, 2017
@filipesilva filipesilva merged commit 73d5628 into angular:master Feb 6, 2017
@beeman beeman deleted the fallback-loader-use branch February 6, 2017 10:13
@HauntedSmores
Copy link

HauntedSmores commented Feb 6, 2017

Im still getting this issue and I deleted node_modules and redid npm install. Is this not on a release branch or something?

I also tried looking for the file to change the lines myself but I dont have a style.ts file

@beeman
Copy link
Contributor Author

beeman commented Feb 6, 2017

@HauntedSmores it's been merged into master, it will be available in the next release.

@HauntedSmores
Copy link

HauntedSmores commented Feb 6, 2017

@beeman Thanks for the response! any idea why I dont have that style.ts file at all?

@beeman
Copy link
Contributor Author

beeman commented Feb 6, 2017

@HauntedSmores this file is part of Angular CLI itself, it's not inside your app.

If you want to manually get rid of this error, the file should be located in node_modules/@angular/cli/models/webpack-configs/styles.ts

@TwanoO67
Copy link

TwanoO67 commented Feb 7, 2017

This is not only a warning, this error appears 4 times during compilation, and it makes webpack compilation fail...

@dags
Copy link

dags commented Feb 7, 2017

any ETA to get this new release ?. Currently, my build is broken ..

@HauntedSmores
Copy link

@beeman I know it is, I checked the path from your repo but I don't have styles.ts in the directory you just gave

@dags
Copy link

dags commented Feb 7, 2017

I think CLI doesn't install individual ts files .. I can't find it either ...

Maybe it is :

/usr/lib/node_modules/@angular/cli/models/webpack-configs/styles.js

on Ubuntu linux.

@dags
Copy link

dags commented Feb 7, 2017

It is also in the project :

./node_modules/@angular/cli/models/webpack-configs/styles.js

@darrenbrett
Copy link

darrenbrett commented Feb 8, 2017

I get this error too when running "ng serve" - although my app still compiles and boots up (see below). So it's more of an annoyance than something critical. But curious, is there a current resolution or do we just need to wait for the next update?

bash-3.2$ ng s
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
** NG Live Development Server is running on http://localhost:4200. **
Hash: 86877c66b943cc1f9090
Time: 37200ms
chunk {0} main.bundle.js, main.bundle.map (main) 754 kB {3} [initial] [rendered]
chunk {1} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 27 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 5.05 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.

@G-Pandey
Copy link

G-Pandey commented Feb 8, 2017

When will the next update be released? I also couldn't find style.ts in the suggested directory. Project does compile successfully but it would be nice to have it resolved asap.

@michaelcm
Copy link

Also looking for a release promptly with this fix. Thanks in advance!

MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this pull request Feb 9, 2017
@elnobun
Copy link

elnobun commented Feb 9, 2017

For those who cannot find it in Angular CLI, the correct path is

node_modules/angular-cli/models/webpack-configs/styles.js

You should see this:

// load global css as css files
    if (globalStylePaths.length > 0) {
        rules.push.apply(rules, baseRules.map(function (_a) {
            var test = _a.test, loaders = _a.loaders;
            return ({
                include: globalStylePaths, test: test, loaders: ExtractTextPlugin.extract({
                    loader: [
                        // css-loader doesn't support webpack.LoaderOptionsPlugin properly,
                        // so we need to add options in its query
                        ("css-loader?" + JSON.stringify({ sourceMap: cssSourceMap }))
                    ].concat(commonLoaders, loaders),
                    fallbackLoader: 'style-loader',
                    // publicPath needed as a workaround https://github.com/angular/angular-cli/issues/4035
                    publicPath: ''
                })
            });
        }));
    }

Change the loader to use, and the fallbackLoader to fallback

ENJOY THE FIX. 👍

@JanStureNielsen
Copy link

@beeman
Copy link
Contributor Author

beeman commented Feb 11, 2017

@JanStureNielsen this has been fixed in the last release

@michaelcm
Copy link

The last release v1.0.0-beta.30 was released 10 days ago, and the patch was pushed 7 days ago... doesn't seem to be included in the last release.
MRHarrison@f5624ab

@beeman
Copy link
Contributor Author

beeman commented Feb 13, 2017

The last release is beta 31 and has the fix. See the readme for the upgrading instructions.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use"