ionic-team / ionic-team/ionic-unit-testing-example

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

Open
#86 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
370
Forks
144
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.