Skip to content

AoTPlugin breaks with Webpack 2.2.0-rc.0 #3581

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

Closed
colltoaction opened this issue Dec 15, 2016 · 14 comments
Closed

AoTPlugin breaks with Webpack 2.2.0-rc.0 #3581

colltoaction opened this issue Dec 15, 2016 · 14 comments

Comments

@colltoaction
Copy link

OS?

Windows 10

C:\Users\...........\node_modules\webpack\bin\webpack.js:285
                throw e;
                ^

TypeError: Cannot read property 'plugin' of null
    at AotPlugin.apply (C:\Users\...........\node_modules\@ngtools\webpack\src\plugin.js:174:34)
    at Compiler.apply (C:\Users\...........\node_modules\tapable\lib\Tapable.js:270:16)
    at WebpackOptionsApply.process (C:\Users\...........\node_modules\webpack\lib\WebpackOptionsApply.js:61:18)
    at webpack (C:\Users\...........\node_modules\webpack\lib\webpack.js:32:48)
    at C:\Users\...........\node_modules\webpack\lib\webpack.js:22:11
    at Array.map (native)
    at webpack (C:\Users\...........\node_modules\webpack\lib\webpack.js:21:40)
    at processOptions (C:\Users\...........\node_modules\webpack\bin\webpack.js:275:14)
    at Object.<anonymous> (C:\Users\...........\node_modules\webpack\bin\webpack.js:335:1)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
@daniele-zurico
Copy link

Any news on that? I've the same issue

@jusefb
Copy link

jusefb commented Dec 20, 2016

Having the same problem would be great to get a resolution

@MrCooper42
Copy link

Also having the same issue! has anyone reverted back to an older version?

@CarmenPopoviciu
Copy link

indeed. having the same problem. I reverted from "@ngtools/webpack": "1.1.5" with "webpack": "2.2.0-rc.1" to "@ngtools/webpack": "1.1.5" with "webpack": "2.1.0-beta.28" and the problem is gone.

@TheLarkInn
Copy link
Member

I have this error solved but I need to work with @hansl to fix the second error. Does anyone have an example of this plugin used outside of the CLI that I can test?

@colltoaction
Copy link
Author

Maybe you can try with https://github.com/angular/universal-starter

@daniele-zurico
Copy link

@TheLarkInn https://github.com/daniele-zurico/webpack-aot just update the versions and is ready.
It has the essential exactly what you need

@CarmenPopoviciu
Copy link

@TheLarkInn or this: https://github.com/blacksonic/angular2-aot-webpack

@TheLarkInn
Copy link
Member

TheLarkInn commented Dec 23, 2016

Thank you 🤗

@TheLarkInn
Copy link
Member

Alright I'm going to leave my findings continuously as I get them.

First issue is access to resolvers needs to happen after they are created:

Since I am working in the JS version and not the TS source, it may look a little different in this example but I already showed this to @hansl:

        var tsConfigPath = this._tsConfigPath;
        var compilerOptions = this._compilerOptions;
        var compilerHost = this._compilerHost;
        compiler.plugin("after-resolvers", function(compiler) {
            compiler.resolvers.normal.plugin('resolve', function (request, cb) {
                if (request.request.match(/\.ts$/)) {
                    _this.done.then(function () { return cb(); });
                }
                else {
                    cb();
                }
            });
            compiler.resolvers.normal.apply(new paths_plugin_1.PathsPlugin({
                tsConfigPath: tsConfigPath,
                compilerOptions: compilerOptions,
                compilerHost: compilerHost
            }));
        });

It looks like now for some reason there is a failure to resolve the virtually created factory file:
screen shot 2016-12-23 at 3 10 15 pm

@hansl hansl closed this as completed in defc269 Dec 30, 2016
@freezy
Copy link

freezy commented Jan 5, 2017

A bugfix release of this would be really cool. Anything on the horizon?

@vlodko
Copy link

vlodko commented Jan 11, 2017

@hansl do you have any information about release date?

@hansl
Copy link
Contributor

hansl commented Jan 18, 2017

It's been released 2 betas ago.

MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
@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 6, 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

No branches or pull requests

9 participants