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

"use client" warnings #49

Closed
Tobbe opened this issue May 25, 2023 · 4 comments · Fixed by #63
Closed

"use client" warnings #49

Tobbe opened this issue May 25, 2023 · 4 comments · Fixed by #63

Comments

@Tobbe
Copy link
Contributor

Tobbe commented May 25, 2023

Running yarn build I see
Module level directives cause errors when bundled, "use client" in "src/Counter.tsx" was ignored.
image

I thought this would have been solved as of @vitejs/plugin-react v4. And just to make sure I was actually using the correct version I ran yarn why
image

The fix is mentioned under "Other notable changes" in the release notes https://github.com/vitejs/vite-plugin-react/releases/tag/plugin-react%404.0.0

So not sure why I'm still seeing it

@dai-shi
Copy link
Owner

dai-shi commented May 25, 2023

So not sure why I'm still seeing it

Me neither 😓

@himself65
Copy link
Contributor

Oh I know why!

@himself65
Copy link
Contributor

It use warning.message.includes('use client'), but we are using "use client" which is double quote😅

https://github.com/vitejs/vite-plugin-react/blob/bf8e967fd63b863b794db1a902c956a31d72d4ff/packages/plugin-react/src/index.ts#L287

@himself65
Copy link
Contributor

But now we still have warning Error when using sourcemap for reporting an error: Can't resolve original location of error.

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 a pull request may close this issue.

3 participants