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

Regression in @sapui5/types of 1.122.1 with tsconfig for wdi5 #434

Closed
LukasHeimann opened this issue Apr 2, 2024 · 5 comments
Closed

Regression in @sapui5/types of 1.122.1 with tsconfig for wdi5 #434

LukasHeimann opened this issue Apr 2, 2024 · 5 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@LukasHeimann
Copy link

Describe the bug
For wdi5-based testing, ui5's types can be used. As the runtime there is not the browser but node, different settings for typescript are used:

  • type "module" in package.json
  • module and moduleResolution Node16intsconfig.json`

Up until version 1.122.0 of the types, this worked without problems -- you could import the ui5 types and use them in your wdi5 config, exactly as advertised. With version 1.122.1 of the types, this broke for some reason. Running tsc --noEmit on a more or less empty project with these settings gives lots of errors, mostly internal to the types, i.e.:
node_modules/@sapui5/types/types/commons-1.122.0-esm-d.ts(3,16): error TS2664: Invalid module name in augmentation, module 'sap/ui/commons/library' cannot be found.

I'm not sure if this could be due to (new?) behavior of the types, where when only some parts of the ui5 distribution are updated to the .1 patch version and others stay at .0, the files are renamed and thus cause the problem with the stricter type resolution settings.

Expected behavior
Projects using wdi5 with TypeScript and the ui5 types should pass a typecheck without problems.

Additional context
For easier debugging, I've created a minimal repository that fails: https://github.com/LukasHeimann/ui5-types-wdi5-issue
It includes steps to reproduce the issue and shows that previous versions are not affected.

I've also included the log output of tsc --noEmit: https://github.com/LukasHeimann/ui5-types-wdi5-issue/blob/main/out.log

@codeworrior
Copy link
Member

This is most likely another symptom of the issue described in #433. Due to an unexpected version mismatch, some files have not been renamed to library.name.d.ts but kept their (build-time) name e.g. commons-1.122.0-esm-d.ts. As those files are NOT named *.d.ts, TypeScript no longer handles them as ambient files, which then causes the errors.

1.123 should fix the problem. Fixes for 1.121 and 1.122 are prepared, so in case a patch will be produced, the issue should be fixed there as well. But I can't say whether or when such patches will be created.

@codeworrior
Copy link
Member

Oh, and - as suggested by @akudev in #433 - you can continue to use 1.122.0 to avoid the problem until fixes become available.

@LukasHeimann
Copy link
Author

Thank you for the quick response! I hadn't seen the closed issue. The workaround works perfectly for us already, but thank you for mentioning that as well :)

@akudev akudev changed the title Regression in types of 1.122.1 with tsconfig for wdi5 Regression in @sapui5/types of 1.122.1 with tsconfig for wdi5 Apr 2, 2024
@akudev
Copy link
Contributor

akudev commented Apr 2, 2024

(Edited the title to make it clear that the issue only occurs in the SAPUI5 types)

@akudev akudev added the bug Something isn't working label Apr 2, 2024
@akudev akudev added the duplicate This issue or pull request already exists label Jun 26, 2024
@akudev
Copy link
Contributor

akudev commented Jun 26, 2024

Verified fixed with the 1.123.0 types

@akudev akudev closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants