-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Module build failed: TypeError: Cannot read property 'afterCompile' of undefined #729
Comments
It sounds like one of the things in the mix isn't webpack 4... I'll leave this open for now but I suspect this isn't a ts-loader issue. |
Tested switching from manual configuration to simpler built-in ts support in Mix support. webpack.mix.js now looks like this:
I also stripped down admin.ts to just:
to make sure there wasn't any actual errors for it to run in to. But still nothing. |
Also happens while running webpack right away:
Config:
|
Whenever you see |
Maybe install ts-loader 3.5.0 if you're not using webpack 4? |
1 similar comment
Maybe install ts-loader 3.5.0 if you're not using webpack 4? |
Can confirm it was a versioning issue. Laravel Mix is presently still on older version of webpack at time of writing. TypeScript compiler was able to run once I swapped out for the 3.5.0 version of ts-loader. |
Thanks for confirming! |
Saved me from endlessly trying different options - thanks @johnnyreilly! |
@johnnyreilly thank u```` |
My pleasure! |
Thanks @johnnyreilly This worked for me . |
For those coming from angular 5+ world. This means that you must install |
Since NS uses Webpack 3, we have to set the version to 3.5.0, as installing the latest versions leads to errors. TypeStrong/ts-loader#729 (comment)
Hello, This is not part of this question. but any one how to fix this.
|
I've just installed this module to use with Laravel's Mix that uses Webpack under the covers. Followed guide for setup here: https://sebastiandedeyne.com/posts/2017/typescript-with-laravel-mix
I'm getting a similar error to:
#728
Module build failed: TypeError: Cannot read property 'afterCompile' of undefined
at successfulTypeScriptInstance (/.../node_modules/ts-loader/dist/instances.js:147:27)
at Object.getTypeScriptInstance (/.../node_modules/ts-loader/dist/instances.js:48:12)
at Object.loader (/.../node_modules/ts-loader/dist/index.js:16:41)
The text was updated successfully, but these errors were encountered: