Skip to content

Commit

Permalink
Update ts-loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
raghur committed Feb 9, 2018
1 parent 14405de commit cbc9859
Show file tree
Hide file tree
Showing 2 changed files with 677 additions and 616 deletions.

4 comments on commit cbc9859

@qazxsw99
Copy link

@qazxsw99 qazxsw99 commented on cbc9859 Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I'm encountering an error when I run webpack in Dev environment. Is it ts-loader not compatible with other package?

ERROR in ./ClientApp/boot.ts
Module build failed: TypeError: Cannot read property 'constructor' of undefined
at Object.getTypeScriptInstance (\vuejs2-typescript-starter-master\node_modules\ts-loader\dist\instances.js:40:38)
at Object.loader (\vuejs2-typescript-starter-master\node_modules\ts-loader\dist\index.js:24:39)
@ multi ./ClientApp/boot.ts

npm list
+-- @types/chai@4.1.2
+-- @types/mocha@2.2.48
+-- @types/sinon@2.3.7
+-- @types/sinon-chai@2.7.29
+-- @types/webpack-env@1.13.5
+-- aspnet-webpack@2.0.3
+-- avoriaz@4.2.0
+-- babel-core@6.26.0
+-- babel-loader@7.1.3
+-- babel-plugin-syntax-dynamic-import@6.18.0
+-- babel-polyfill@6.26.0
+-- babel-preset-env@1.6.1
+-- babel-preset-es2015@6.24.1
+-- babel-preset-es2015-mod@6.6.0
+-- babel-preset-es3@1.0.1
+-- bootstrap@3.3.7
+-- chai@4.1.2
+-- css-loader@0.25.0
+-- event-source-polyfill@0.0.7
+-- extract-text-webpack-plugin@2.1.2
+-- file-loader@0.9.0
+-- fork-ts-checker-webpack-plugin@0.2.10
+-- isomorphic-fetch@2.2.1
+-- istanbul-instrumenter-loader@3.0.0
+-- jquery@3.3.1
+-- jsdom@11.6.2
+-- karma@1.7.1
+-- karma-coverage-istanbul-reporter@1.4.1
+-- karma-jsdom-launcher@6.1.3
+-- karma-mocha@1.3.0
+-- karma-phantomjs-launcher@1.0.4
+-- karma-sinon-chai@1.3.3
+-- karma-sourcemap-loader@0.3.7
+-- karma-spec-reporter@0.0.31
+-- karma-webpack@2.0.13
+-- mocha@3.5.3
+-- sinon@3.3.0
+-- sinon-chai@2.14.0
+-- style-loader@0.13.2
+-- ts-loader@3.5.0
+-- typescript@2.7.2
+-- url-loader@0.5.9
+-- vue@2.5.13
+-- vue-loader@11.3.4
+-- vue-property-decorator@6.0.0
+-- vue-router@3.0.1
+-- vue-template-compiler@2.5.13
+-- vuex@3.0.1
+-- webpack@2.7.0
`-- webpack-hot-middleware@2.21.2

@raghur
Copy link
Owner Author

@raghur raghur commented on cbc9859 Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've recently seen this happen - I believe this is due to chalk. See this
TypeStrong/ts-loader#664

Given that I depend on v3.5.0, it shouldn't happen - but it does. I've found that you can get around it by depending on chalk directly like so

npm i -D chalk

npm shrinkwrap should really be saving us from dependency problems, but I've found that it doesn't always help. In any case, can you try the above - add chalk and see?

@raghur
Copy link
Owner Author

@raghur raghur commented on cbc9859 Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed an update to the repo - it now uses Yarn instead of NPM and ideally we shouldn't have things automagically breaking just because some 4th level dependency decided to ship an update.

@qazxsw99
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It solved the first problem after run npm i -D chalk. Thanks :)
But I found another issues caused by css-loader. link
So I upgrade css-loader to 0.28.10 to resolve the issues.

npm list

+-- @types/chai@4.0.4
+-- @types/mocha@2.2.48
+-- @types/sinon@2.3.3
+-- @types/sinon-chai@2.7.29
+-- @types/webpack-env@1.13.5
+-- aspnet-webpack@2.0.3
+-- avoriaz@4.2.0
+-- babel-core@6.26.0
+-- babel-loader@7.1.3
+-- babel-plugin-syntax-dynamic-import@6.18.0
+-- babel-polyfill@6.26.0
+-- babel-preset-env@1.6.1
+-- babel-preset-es2015@6.24.1
+-- babel-preset-es2015-mod@6.6.0
+-- babel-preset-es3@1.0.1
+-- bootstrap@3.3.7
+-- chai@4.1.2
+-- chalk@2.3.2
+-- css-loader@0.28.10
+-- event-source-polyfill@0.0.7
+-- extract-text-webpack-plugin@2.1.2
+-- file-loader@0.9.0
+-- fork-ts-checker-webpack-plugin@0.2.10
+-- isomorphic-fetch@2.2.1
+-- istanbul-instrumenter-loader@3.0.0
+-- jquery@3.3.1
+-- jsdom@11.6.2
+-- karma@1.7.1
+-- karma-coverage-istanbul-reporter@1.4.1
+-- karma-jsdom-launcher@6.1.3
+-- karma-mocha@1.3.0
+-- karma-phantomjs-launcher@1.0.4
+-- karma-sinon-chai@1.3.3
+-- karma-sourcemap-loader@0.3.7
+-- karma-spec-reporter@0.0.31
+-- karma-webpack@2.0.13
+-- mocha@3.5.3
+-- sinon@3.3.0
+-- sinon-chai@2.14.0
+-- style-loader@0.13.2
+-- ts-loader@3.5.0
+-- typescript@2.7.2
+-- url-loader@0.5.9
+-- vue@2.5.13
+-- vue-loader@11.3.4
+-- vue-property-decorator@6.0.0
+-- vue-router@3.0.1
+-- vue-template-compiler@2.5.13
+-- vuex@3.0.1
+-- webpack@2.7.0
`-- webpack-hot-middleware@2.21.2

Please sign in to comment.