ts-loader: Webpack 2.0 - Cannot read property 'unsafeCache' of undefined
Please read right to the bottom of this thread for an approach that seems to work.
Using webpack@2.1.0-beta.23
:
ERROR in ./src/index.tsx
Module build failed: TypeError: Cannot read property 'unsafeCache' of undefined
at makeResolver (/Users/foo/node_modules/ts-loader/resolver.js:35:57)
at ensureTypeScriptInstance (/Users/foo/node_modules/ts-loader/index.js:207:20)
at Object.loader (/Users/foo/node_modules/ts-loader/index.js:387:14)
Used as:
export const tsLoader = {
test: /\.ts(x?)$/,
loader: `ts-loader?silent=true`
};
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 7
- Comments: 16 (9 by maintainers)
I tried
awesome-typescript-loader
and couldn’t get it working so I decided to take a stab at figuring out how to fix this.@r-park @johnnyreilly @donaldpipowitch @josiah1888 by
console.log
ing in the place the error occured, I found that theoptions
is actually theoptions
from theLoaderOptionsPlugin
. By doing this:Everything runs again.
I switched to https://github.com/s-panferov/awesome-typescript-loader. Works fine.