Skip to content
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

Cannot read property 'constructor' of undefined #664

Closed
lmk123 opened this issue Oct 20, 2017 · 4 comments
Closed

Cannot read property 'constructor' of undefined #664

lmk123 opened this issue Oct 20, 2017 · 4 comments

Comments

@lmk123
Copy link

lmk123 commented Oct 20, 2017

After I upgrade to 3.0.4 it show me the errors:

ERROR in ./src/index.ts
Module build failed: TypeError: Cannot read property 'constructor' of undefined
    at Object.getTypeScriptInstance (./node_modules/ts-loader/dist/instances.js:26:37)
    at Object.loader (./node_modules/ts-loader/dist/index.js:24:39)

Fallback to 3.0.3 works great.

@johnnyreilly
Copy link
Member

johnnyreilly commented Oct 20, 2017

Please could you provide a minimal repro repo to illustrate this?

We started compiling with ts-loader 2.2.0 with this release. That's supposed to be backward compatible.

Do you have chalk as a dependency? If so, could you try pinning it to v2.2.0?

Also, what version of node are you running? I think that as a minimum you need node 4...

@lmk123
Copy link
Author

lmk123 commented Oct 20, 2017

After I pinning chalk to v2.2.0 it works!

npm i chalk@2.2.0 -D

Before that I don't install chalk by myself. It's a dependency by ts-loader and my chalk is v2.1.0 in the node_modules folder.

I'm using node 8

$ node -v
8.4.0

@johnnyreilly
Copy link
Member

Hmmm sounds like chalk 2.2 is breaking changes.

@johnnyreilly
Copy link
Member

Made ts-loader require 2.2 as a minimum and released as 3.0.5

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants