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

chore: revert ts moduleResoluition node16 to node #7030

Merged
merged 1 commit into from
May 15, 2023

Conversation

ilhan007
Copy link
Member

@ilhan007 ilhan007 commented May 15, 2023

Recently we changed our tsconfig to use Module Resolution "node 16", instead of "node" to get better ECMAScript Module Support:

  • 'node' for Node.js’ CommonJS implementation
  • 'node16' or 'nodenext' for Node.js’ ECMAScript Module Support from TypeScript 4.7

However, we faced issues on the application side. The TS compiler throws errors in Typescript applications that uses UI5 Web Components for files in applications' node_modules. More specifically, the problem was caused by new attribute "'resolution-mode'" added to the auto-generated .d.ts files that requires also tsconfig change by the project installed our code.

Error: node_modules/@ui5/webcomponents/dist/DateComponentBase.d.ts:1:23 - error TS1452: 
'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`.
/// <reference types="openui5" resolution-mode="require"/>

Although these errors can be handled with skipLibCheck flag set to "true", it's a bad experience to require a particular flag to just make an app working and we decided to revert this as it's seems the setting is not stable enough and can cause unexpected problems for consumers.

Related to: #7020 (comment)
Reverts: #6981

@ilhan007 ilhan007 changed the title chore: revert ts moduleResoluition node16 to node chore: revert ts moduleResoluition node16 to node May 15, 2023
@ilhan007 ilhan007 requested review from pskelin, g-cheishvili, MarcusNotheis, nnaydenow and vladitasev and removed request for MarcusNotheis May 15, 2023 08:56
@ilhan007 ilhan007 merged commit 5eb5c3d into main May 15, 2023
@ilhan007 ilhan007 deleted the chore-revert-ts-moduleResoluition branch May 15, 2023 09:45
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