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

new-log-viewer: Upgrade to TypeScript 5.6.2; Update module resolution to "Bundler" in tsconfig.json to support new TypeScript. #67

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

junhaoliao
Copy link
Collaborator

@junhaoliao junhaoliao commented Sep 11, 2024

References

new-log-viewer series: #45 #46 #48 #51 #52 #53 #54 #55 #56 #59 #60 #61 #62 #63 #66

It was found that after removing package-lock.json and re-running npm i, now npm resolves TypeScript's version to a newer one which has a different module resolution behaviour with "moduleResolution": "NodeNext" in tsconfig.json.

Imports from sources without file extensions no longer work. e.g.,

TS2835: Relative import paths need explicit file extensions in ECMAScript imports when --moduleResolution is node16 or nodenext. Did you mean ./ decoders. js?

Release 5.6 Changelog:
https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/#respecting-file-extensions-and-package.json-from-within-node_modules14

Docs:
https://www.typescriptlang.org/tsconfig/#moduleResolution

Discussions:
microsoft/TypeScript#51714

Description

  1. Upgrade TypeScript version to 5.6.2 explicitly in package.json.
  2. Update module resolution to "Bundler" in tsconfig.json.

Validation performed

  1. No longer observed the TS2835 issues.

Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

For the PR title, how about:

new-log-viewer: Upgrade to TypeScript 5.6.2; Update module resolution to "Bundler" in tsconfig.json to support new TypeScript.

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

Successfully merging this pull request may close these issues.

2 participants