Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ChellappanRajan
Copy link

Fix #5046

@changeset-bot
Copy link

changeset-bot bot commented Aug 25, 2025

🦋 Changeset detected

Latest commit: 20df2b9

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/nextjs 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
Collaborator

@justinfagnani justinfagnani left a comment

Choose a reason for hiding this comment

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

Thanks @ChellappanRajan!

Just a couple of comments, and this needs a changeset. Run: npm run changeset, select this package, choose "patch" and enter a description.

const {
addDeclarativeShadowDomPolyfill = true,
webpackModuleRulesTest = /\/pages\/.*\.(?:j|t)sx?$|\/app\/.*\.(?:j|t)sx?$/,
webpackModuleRulesTest = /[\\/]pages[\\/].*\.(?:j|t)sx?$|[\\/]app[\\/].*\.(?:j|t)sx?$/,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The only thing I worry about is \ being a valid file name character on Unixes. Can we construct the regex dynamically based on which operating system we're running on?

Copy link
Author

Choose a reason for hiding this comment

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

Do you think it would be better to use the Node.js path package (https://nodejs.org/api/path.html#pathsep such as path.sep) to construct and check paths dynamically depending on the operating system?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that would be a good way to do it, along with the RegExp constructor.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for confirming. I am currently away from my laptop. I will apply the changes and update the PR once I am back.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I have addressed the comments — please take another look

addDeclarativeShadowDomPolyfill = true,
webpackModuleRulesTest = /\/pages\/.*\.(?:j|t)sx?$|\/app\/.*\.(?:j|t)sx?$/,
webpackModuleRulesTest = /[\\/]pages[\\/].*\.(?:j|t)sx?$|[\\/]app[\\/].*\.(?:j|t)sx?$/,
webpackModuleRulesExclude = [/next\/dist\//, /node_modules/],
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to update the separators here too.

…ormalized path handling

- Applied changes based on PR review comments
- Ensured regex works cross-platform by normalizing path separators
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.

@lit-labs/nextjs renders only on client side in Windows (works fine on macOS)

2 participants