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 'version' of undefined at Object.getScriptVersion #1645

Closed
johnjayhopley opened this issue May 15, 2020 · 5 comments
Closed
Labels
Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage

Comments

@johnjayhopley
Copy link

πŸ› Bug Report

Updated to npm version 25.5.1 but i am still getting the following error - only on a windows build server

● Test suite failed to run

TypeError: Cannot read property 'version' of undefined

  at Object.getScriptVersion (node_modules/ts-jest/dist/compiler/language-service.js:85:68)

Npm packages:
jest:
ts-jest:
typescript:
babel(optional):

@johnjayhopley johnjayhopley added Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage labels May 15, 2020
@ahnpnl
Copy link
Collaborator

ahnpnl commented May 15, 2020

duplicate #1639

@ahnpnl ahnpnl closed this as completed May 15, 2020
@thehappybug
Copy link

I'm blocked on this issue and might not be able to update for some time to the latest ts-jest version (due to other dependencies). Is there a workaround for this issue that I can apply to my code? Do we know the cause of this issue?

@ahnpnl
Copy link
Collaborator

ahnpnl commented Oct 19, 2020

@thehappybug there are 2 workarounds:

  • Either Use isolatedModules: true in combination with tsc --noEmit .

  • Or always run tests without cache in case of not using isolatedModules: true

  • Or just upgrade ts-jest to 26 (should work with jest 25) and disable version warning message via environment variable, see https://kulshekhar.github.io/ts-jest/user/config/#version-checking

@thehappybug
Copy link

thehappybug commented Oct 19, 2020

Thank you. This worked for me. I've enabled isolated modules and used it with tsc --noEmit.

@anku580
Copy link

anku580 commented Jun 9, 2021

I faced the same issue. I was using v25.0.0 but after updating it to v26.0.0 the issue got fixed.

Thank you @ahnpnl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage
Projects
None yet
Development

No branches or pull requests

4 participants