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

Typescript 4.5.2: Cannot read property 'impliedNodeFormat' of undefined #125

Closed
adrianbw opened this issue Dec 3, 2021 · 4 comments
Closed

Comments

@adrianbw
Copy link

adrianbw commented Dec 3, 2021

I've got several react/typescript repositories using ttypescript that have started throwing this error since our upgrade to 4.5.2. I haven't been able to isolate what the cause is, though. Unfortunately, I'm also going to be no longer at the company with this problem in about two hours, but I wanted to make sure this was noted.

@MR4online
Copy link

MR4online commented Dec 7, 2021

also having this issue. Stacktrace:

        if (file.impliedNodeFormat === undefined)
                 ^
TypeError: Cannot read properties of undefined (reading 'impliedNodeFormat')
    at Object.getModeForUsageLocation ([PATH]/node_modules/typescript/lib/typescript.js:113474:18)
    at resolveExternalModule ([PATH]/node_modules/typescript/lib/typescript.js:49819:90)
    at resolveExternalModuleNameWorker ([PATH]/node_modules/typescript/lib/typescript.js:49795:19)
    at getExternalModuleFileFromDeclaration ([PATH]/node_modules/typescript/lib/typescript.js:85155:32)
    at Object.getExternalModuleFileFromDeclaration ([PATH]/node_modules/typescript/lib/typescript.js:84994:36)
    at tryGetModuleNameFromDeclaration ([PATH]/node_modules/typescript/lib/typescript.js:29322:59)
    at Object.getExternalModuleNameLiteral ([PATH]/node_modules/typescript/lib/typescript.js:29286:20)
    at createRequireCall ([PATH]/node_modules/typescript/lib/typescript.js:102481:33)
    at visitImportDeclaration ([PATH]/node_modules/typescript/lib/typescript.js:102441:80)
    at topLevelVisitor ([PATH]/node_modules/typescript/lib/typescript.js:102090:28)`

@vdineva
Copy link

vdineva commented Dec 14, 2021

Same issue when upgrading from 4.4.x to 4.5.x version of typescript

@skilbjo
Copy link

skilbjo commented Dec 21, 2021

This may be an issue with a plugin you're using rather than an issue with ttsc per se.

I only use ttsc to get access to this plugin: @zerollup/ts-transform-paths so I can resolve absolute paths at typescript build time.

I was experiencing the same issue described above, but the patch-package solution described zerkalica/zerollup#37 fixed my issue. Hopefully helps you as well.

@adrianbw
Copy link
Author

Bless you, thanks.

@cevek cevek closed this as completed Jan 1, 2022
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

5 participants