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

fix: fix normalizeReferenceId #99

Merged
merged 3 commits into from
Jul 22, 2024
Merged

fix: fix normalizeReferenceId #99

merged 3 commits into from
Jul 22, 2024

Conversation

hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented Jul 22, 2024

This test is supposed to pass, but it looks like this is failing since #97.

The difference is obvious from terminal log when changing "use client" files:

## before
3:53:16 PM [vite] (client) hmr update /src/routes/_client.tsx

## after
3:52:45 PM [vite] (client) hmr update /home/hiroshi/code/personal/vite-environment-examples/examples/react-server/src/routes/_client.tsx

Also note that similar "absolute path" issue is happening when testing Vite 6 in Vite 5 RSC hi-ogawa/vite-plugins#297 even though these two use a different approach.

Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @hi-ogawa and the rest of your teammates on Graphite Graphite

@hi-ogawa hi-ogawa marked this pull request as ready for review July 22, 2024 07:44
@@ -226,7 +226,7 @@ function vitePluginUseClient(): PluginOption {
}
manager.clientReferenceMap.delete(id);
if (code.includes("use client")) {
const runtimeId = await normalizeReferenceId(id, "react-server");
const runtimeId = await normalizeReferenceId(id, "client");
Copy link
Owner Author

@hi-ogawa hi-ogawa Jul 22, 2024

Choose a reason for hiding this comment

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

It looks like this was a simple typo, but then I'm not sure what's happening in hi-ogawa/vite-plugins#297 since there's no equivalent logic.

@hi-ogawa hi-ogawa changed the title test: test client reference module matches browser hmr module fix: fix normalizeReferenceId Jul 22, 2024
@hi-ogawa hi-ogawa merged commit 0128d3b into main Jul 22, 2024
1 check passed
@hi-ogawa hi-ogawa deleted the fix-browser-hmr-path branch July 22, 2024 07:46
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.

1 participant