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

fix(create-package): revert moduleResolution setting to node #7020

Merged
merged 1 commit into from
May 11, 2023

Conversation

ilhan007
Copy link
Member

We found issues with 3rd party generated packages with the create-package tools, caused by the recently updated (with the latest 1.13.0) tsconfig setting for moduleResolution -node16 . The package is not ready for node16, it requires more efforts to make it work, thus reverting back to node to have at least a stable state and the running properly as before.

@ilhan007 ilhan007 closed this May 11, 2023
@ilhan007 ilhan007 reopened this May 11, 2023
@ilhan007 ilhan007 merged commit 9fc84e2 into main May 11, 2023
@ilhan007 ilhan007 deleted the revert-create-package-moduleResolution branch May 11, 2023 14:21
@g-cheishvili
Copy link

This still happens with [email protected]

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`.

1 /// <reference types="openui5" resolution-mode="require"/>
                        ~~~~~~~


Error: node_modules/@ui5/webcomponents/dist/DateRangePicker.d.ts:1:23 - error TS1452: 'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`.

1 /// <reference types="openui5" resolution-mode="require"/>
                        ~~~~~~~


Error: node_modules/@ui5/webcomponents/dist/TimePicker.d.ts:1:23 - error TS1452: 'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`.

1 /// <reference types="openui5" resolution-mode="require"/>
                        ~~~~~~~


Error: node_modules/@ui5/webcomponents/dist/TimePickerBase.d.ts:1:23 - error TS1452: 'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`.

1 /// <reference types="openui5" resolution-mode="require"/>
                        ~~~~~~~


Error: node_modules/@ui5/webcomponents/dist/TimeSelection.d.ts:1:23 - error TS1452: 'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`.

1 /// <reference types="openui5" resolution-mode="require"/>
                        ~~~~~~~

@g-cheishvili
Copy link

g-cheishvili commented May 12, 2023

If I set Angular application to use node16 resolution, everything goes to hell basically.

@ilhan007

ilhan007 added a commit that referenced this pull request May 15, 2023
Recently we [changed](#6981) our tsconfig to use Module Resolution ["node 16",](https://www.typescriptlang.org/tsconfig#moduleResolution) 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](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs)

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.

```sh
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
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