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: remove extra 'use client' directive #261

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

Kinbaum
Copy link
Contributor

@Kinbaum Kinbaum commented Feb 6, 2024

When using Next.js and SWC plugin coverage instrumentation, you will get this error due to the duplication of the use client directive:

Error: 
  × The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.
   ╭─[/node_modules/.pnpm/vaul@0.9.0_@types+react-dom@18.2.17_@types+react@18.2.43_react-dom@18.2.0_react@18.2.0/node_modules/vaul/dist/index.mjs:1:1]
 1 │ "use client"
 2 │ "use client";import * as L from "@radix-ui/react-dialog";

Since you've already got this included in the index, there's no need for this config option.
Removing the banner resolves the issue with the plugin.

When using Next.js and SWC plugin coverage instrumentation, you will get this error due to the duplication of the use client directive:

```
Error: 
  × The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.
   ╭─[/node_modules/.pnpm/vaul@0.9.0_@types+react-dom@18.2.17_@types+react@18.2.43_react-dom@18.2.0_react@18.2.0/node_modules/vaul/dist/index.mjs:1:1]
 1 │ "use client"
 2 │ "use client";import * as L from "@radix-ui/react-dialog";
```
Copy link

vercel bot commented Feb 6, 2024

@Kinbaum is attempting to deploy a commit to the emil Team on Vercel.

A member of the Team first needs to authorize it.

@emilkowalski emilkowalski merged commit 6e0127d into emilkowalski:main Feb 9, 2024
1 of 2 checks passed
@Kinbaum Kinbaum deleted the patch-1 branch February 9, 2024 20:01
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.

None yet

2 participants