Skip to content

Conversation

@louis-bompart
Copy link
Contributor

Fixes #4943

Import barrels from trusted-types/lib explicitly for compatibility with modern Node resolution.

I added a minimal test project and cover for a few module/moduleResolution pairs that I think are likely to be used with Lit.

This is related in some ways to
https://github.com/lit/lit/blob/main/CONTRIBUTING.md#typescript.
trusted-types was imported as an implicit directory index file (aka barrel), which is not supported with the module resolution algorithm of NodeJS (w/ ESM): https://nodejs.org/api/esm.html#mandatory-file-extensions.

@changeset-bot
Copy link

changeset-bot bot commented Mar 28, 2025

🦋 Changeset detected

Latest commit: 1b4cb4b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
lit-html Patch
lit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@augustjk augustjk left a comment

Choose a reason for hiding this comment

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

thanks! just some minor suggestions.

- Bump lit
- Replace pinned ws import by wildcard
- Typo

Co-authored-by: Augustine Kim <[email protected]>
Copy link
Member

@augustjk augustjk left a comment

Choose a reason for hiding this comment

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

🎉

@sorvell sorvell merged commit 0a9bc72 into lit:main Mar 29, 2025
6 of 7 checks passed
@louis-bompart louis-bompart deleted the fix/4943 branch March 29, 2025 14:51
@lit-robot lit-robot mentioned this pull request Apr 10, 2025
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.

[ts5.8.2+node16] error TS2307: Cannot find module 'trusted-types/lib' or its corresponding type declarations

3 participants