Ts-loader: Got errors while compiling typescript using webpack 4.0 via gulp

Created on 26 Feb 2018  路  4Comments  路  Source: TypeStrong/ts-loader

Compilation with webpack 3 works well, but upgrading to webpack 4 produces following errors.
ts-loader is upgraded to 4.0.0.

Error: test.ts
Module build failed: TypeError: Cannot read property 'afterCompile' of undefined
at successfulTypeScriptInstance (node_modules\ts-loader\dist\instances.js:147:28)
at Object.getTypeScriptInstance (node_modules\ts-loader\dist\instances.js:48:12)
at Object.loader (node_modules\ts-loader\dist\index.js:16:41)
@ multi ./test./test2
Module build failed: TypeError: Cannot set property 'tsLoaderDefinitionFileVersions' of undefined
at getEmit (node_modules\ts-loader\dist\index.js:202:61)
at successLoader (node_modules\ts-loader\dist\index.js:34:11)
at Object.loader (node_modules\ts-loader\dist\index.js:21:12)
@ multi ./src/content/content

Most helpful comment

I'm afraid there's no real information there that helps me to help you!

It could be worth you taking a look at one of the examples that I've ported to webpack 4: https://github.com/TypeStrong/ts-loader/tree/master/examples/vanilla

Are you sure all your webpack packages are webpack 4 related?

All 4 comments

I'm afraid there's no real information there that helps me to help you!

It could be worth you taking a look at one of the examples that I've ported to webpack 4: https://github.com/TypeStrong/ts-loader/tree/master/examples/vanilla

Are you sure all your webpack packages are webpack 4 related?

I upgraded all packages.
It could be gulp webpack that makes problem.
Do you have sample with gulp ?

I don't, no. TBH it's only one day since the release. It may be the maintainer hasn't had chance to release yet

I found this https://github.com/shama/webpack-stream/issues/180
Hopefully it will be soon resolved.

Was this page helpful?
0 / 5 - 0 ratings