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

[BUG] Symlink to sap__types is deleted after each npm command #216

Closed
1 task done
levkovsb opened this issue Aug 29, 2024 · 4 comments
Closed
1 task done

[BUG] Symlink to sap__types is deleted after each npm command #216

levkovsb opened this issue Aug 29, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@levkovsb
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

We use @cap-js/cds-types in a monorepo setup as devDependency. Every npm command in any workspace deletes the symlink to sap__types in the node_modules folder at the root level.

Expected Behavior

Symlink should not be deleted. Even better, provide an npm package instead of a symlink

References

The issue appeared after upgrading to the version 8 of @sap/cds. No problems were detected when using version 7. https://cap.cloud.sap/docs/releases/jun24#typescript

Versions

| ---------------------- | ------------------------------------------------------------------------------------ |
| @cap-js/asyncapi | 1.0.2 |
| @cap-js/openapi | 1.0.5 |
| @sap/cds | 8.1.0 |
| @sap/cds-compiler | 5.1.2 |
| @sap/cds-dk (global) | 8.1.1 |
| @sap/cds-fiori | 1.2.7 |
| @sap/cds-foss | 5.0.1 |
| @sap/cds-mtxs | 2.0.5 |
| @sap/eslint-plugin-cds | 3.0.4 |
| Node.js | v20.11.1 |

Anything else? Logs?

No response

@levkovsb levkovsb added the bug Something isn't working label Aug 29, 2024
@KikiSuperhero
Copy link

KikiSuperhero commented Sep 9, 2024

I have encountered the same issue. @levkovsb have you found any quickfixes in the meantime?

Update: upgrading to version 0.6.5 has fixed the issue for me.

@daogrady
Copy link
Contributor

daogrady commented Sep 10, 2024

Hi @levkovsb ,

sorry for the delay.

Even better, provide an npm package instead of a symlink

@cap-js/cds-types is an npm package. Sadly, the only viable way to get IDEs like vscode to look up types for other modules is by putting them in node_modules/@types/..., which is the namespace reserved for definitely-typed. As we can currently not move in with DT, symlinking is the only option we can provide out of the box. Resourceful users have found another solution to forgo the symlinking. But please check if the issue persists with the latest version of cds-types first.

Best,
Daniel

@daogrady
Copy link
Contributor

Considering this fixed in the latest version of cds-types. Should it resurface on 0.6.5 and later for you, feel free to reopen.

@levkovsb
Copy link
Author

The issue persists in the version 0.6.5. As long as I execute any npm script in one of the workspaces of our monorepo, the symlink is gone and the project is no longer runnable. Please investigate further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants