Skip to content

Uncaught Error: Module build failed: TypeError: Cannot read property 'afterCompile' of undefined #86

Open

Description

@itslenny

I followed the instructions for setting up testing on my Ionic project, but I got the error Uncaught Error: Module build failed: TypeError: Cannot read property 'afterCompile' of undefined

After some investigation I realized that Ionic uses webpack 3, but the default version of ts-loader installed with npm install is for webpack 4. Please update the blog entry to install a 3.x.x version of ts-loader.

For anyone facing this error you can simply install the correct version of ts-loader manually like this...

npm uninstall -D ts-loader
npm install -D ts-loader@3.x.x

Activity

  1. wilfredonoyola commented on Mar 29, 2018

    @wilfredonoyola

    @itslenny please you sure the add the package.json correct. Read more here

  2. itslenny commented on Mar 29, 2018

    @itslenny
    Author

    @wilfredonoyola I'm aware of what the issue is, and I've already fixed it on my end.

    I'm saying that in the instructions on the blog post it should be npm install ts-loader@3.x.x instead of just npm install ts-loader if you expect new people to be able to follow the instructions and have them work.

  3. leifwells commented on Mar 29, 2018

    @leifwells
    Contributor

    @itslenny Sorry the blog post isn't completely up-to-date. I'll update it over the weekend.

    Things change quickly these days and keeping blog posts updated can be difficult.

    When I have updated the blog post, I'll close this issue.

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions