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

Rollup build warning due to 'use client' directive in Radix UI packages (mjs) #3281

Open
sungik-choi opened this issue Dec 10, 2024 · 0 comments

Comments

@sungik-choi
Copy link

Bug report

Current Behavior

During the build process with Rollup, the following warning occurs:

@channel.io/bezier-react:build: (!) ../../node_modules/@radix-ui/react-toggle/dist/index.mjs (1:0): Error when using sourcemap for reporting an error: Can't resolve original location of error.
@channel.io/bezier-react:build: /Users/edchoi/Desktop/Channel/bezier-react/node_modules/@radix-ui/react-toggle/dist/index.mjs:1:0

Upon investigation, the 'use client' directive in the first line is missing from the 'sourcesContent' in the sourcemap file of index.mjs. While the sourcemap mapping works correctly, the build warning persists.

index.js index.js.map index.mjs index.mjs.map (No 'use client')
image image image image

Expected behavior

The build process should complete without warnings.

Reproducible example

None

Suggested solution

Include the 'use client' directive in the 'sourcesContent' of the sourcemap file

Additional context

Your environment

Software Name(s) Version
Radix Package(s) react-components 1.1.0
Node n/a 18.20.5
npm/yarn yarn 4.3.1
Operating System macOS 15.1.1
Rollup n/a 4.28.1
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

No branches or pull requests

1 participant