Skip to content

AoTPlugin breaks with Webpack 2.2.0-rc.0 #3581

Closed

Description

@colltoaction

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

Activity

  1. daniele-zurico commented on Dec 19, 2016

    @daniele-zurico

    Any news on that? I've the same issue

  2. jusefb commented on Dec 20, 2016

    @jusefb

    Having the same problem would be great to get a resolution

  3. MrCooper42 commented on Dec 21, 2016

    @MrCooper42

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

  4. CarmenPopoviciu commented on Dec 23, 2016

    @CarmenPopoviciu

    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.

  5. TheLarkInn commented on Dec 23, 2016

    @TheLarkInn
    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?

  6. colltoaction commented on Dec 23, 2016

    @colltoaction
    Author
  7. daniele-zurico commented on Dec 23, 2016

    @daniele-zurico

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

  8. CarmenPopoviciu commented on Dec 23, 2016

    @CarmenPopoviciu
  9. TheLarkInn commented on Dec 23, 2016

    @TheLarkInn
    Member

    Thank you 🤗

  10. TheLarkInn commented on Dec 23, 2016

    @TheLarkInn
    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

  11. freezy commented on Jan 5, 2017

    @freezy

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

  12. vlodko commented on Jan 11, 2017

    @vlodko

    @hansl do you have any information about release date?

  13. hansl commented on Jan 18, 2017

    @hansl
    Contributor

    It's been released 2 betas ago.

  14. added a commit that references this issue on Feb 9, 2017
    0c84ab1
  15. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  16. locked and limited conversation to collaborators on Sep 6, 2019
  17. added a commit that references this issue on May 29, 2026
    7bce1ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions