Skip to content

[labs/ssr] Change @types/node to a peer dependency and range to prevent conflicts in consumer projects#4820

Merged
augustjk merged 1 commit intolit:mainfrom
kyubisation:fix-node-types-version-conflict
Nov 20, 2025
Merged

[labs/ssr] Change @types/node to a peer dependency and range to prevent conflicts in consumer projects#4820
augustjk merged 1 commit intolit:mainfrom
kyubisation:fix-node-types-version-conflict

Conversation

@kyubisation
Copy link
Contributor

@kyubisation kyubisation commented Nov 6, 2024

Currently the @lit-labs/ssr package uses ^16.0.0 as the dependency version for @types/node. This causes npm or yarn install in consuming projects to complain about version incompatibility, if the project uses a newer major version.
This PR changes the dependency to a peer dependency with a version range of >=18.0.0 <25.0.0 (18 being the oldest still supported LTS version).

@kyubisation kyubisation force-pushed the fix-node-types-version-conflict branch from 9422f92 to d08aea5 Compare November 7, 2024 17:11
@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2024

🦋 Changeset detected

Latest commit: 79a62d1

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

This PR includes changesets to release 1 package
Name Type
@lit-labs/ssr 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

@kyubisation kyubisation force-pushed the fix-node-types-version-conflict branch from d08aea5 to 346fee3 Compare November 21, 2024 19:24
@kyubisation kyubisation changed the title [labs/ssr] Update @types/node dependency range to prevent conflicts in consumer projects [labs/ssr] Change @types/node to a peer dependency and range to prevent conflicts in consumer projects Nov 21, 2024
@kyubisation kyubisation force-pushed the fix-node-types-version-conflict branch from 346fee3 to 037990e Compare November 21, 2024 19:28
Copy link
Contributor

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

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

Random review/opinion on a couple points ;)

@kyubisation kyubisation force-pushed the fix-node-types-version-conflict branch from 037990e to 6bad459 Compare November 22, 2024 10:49
@kyubisation
Copy link
Contributor Author

@louis-bompart I updated the PR as suggested. Thanks for the review.

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!

@kyubisation
Copy link
Contributor Author

Sorry, I did not realize updating the Node.js version breaks the custom vm types. This only happens, if you delete the previously built files.
I'll have a look, whether I can figure out the differences.

@kyubisation kyubisation marked this pull request as draft July 30, 2025 20:37
@kyubisation kyubisation force-pushed the fix-node-types-version-conflict branch from 6bad459 to db8afef Compare August 4, 2025 22:28
@kyubisation
Copy link
Contributor Author

@augustjk I have re-applied to changes the actual state of the main branch and resolved the vm types. Can you take another look?

@kyubisation kyubisation marked this pull request as ready for review August 4, 2025 22:37
@kyubisation kyubisation force-pushed the fix-node-types-version-conflict branch from db8afef to e83749b Compare August 4, 2025 22:41
Copy link
Member

Choose a reason for hiding this comment

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

@justinfagnani do you recall why we needed these custom types? maybe @types/node was lacking at the time, and it's safe to rely on that now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With @types/node <= 16, these types were not defined. With @types/node 18 they were incompatible. With @types/node >= 20 they seem to be obsolete.

@kyubisation
Copy link
Contributor Author

The failing tests are timeouts. As the tests are successful locally, I assume a rerun should fix it.

@kyubisation kyubisation force-pushed the fix-node-types-version-conflict branch from e83749b to 07464b7 Compare October 26, 2025 20:30
@kyubisation kyubisation force-pushed the fix-node-types-version-conflict branch from 07464b7 to 79a62d1 Compare October 26, 2025 20:42
@kyubisation
Copy link
Contributor Author

@augustjk Can I ask you to merge this?

@augustjk augustjk merged commit 7fc2449 into lit:main Nov 20, 2025
7 checks passed
@kyubisation kyubisation deleted the fix-node-types-version-conflict branch November 20, 2025 19:31
@kyubisation
Copy link
Contributor Author

@augustjk Thank you very much! 😃

@lit-robot lit-robot mentioned this pull request Dec 18, 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.

3 participants