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' doesn't work in library if it uses export * #75128

Open
Janpot opened this issue Jan 21, 2025 · 0 comments
Open

'use client' doesn't work in library if it uses export * #75128

Janpot opened this issue Jan 21, 2025 · 0 comments

Comments

@Janpot
Copy link
Contributor

Janpot commented Jan 21, 2025

Link to the code that reproduces this issue

https://stackblitz.com/edit/stackblitz-starters-mzcwat3y

To Reproduce

  1. Open the codesandbox

  2. Let it start up

  3. Observe the error

    Error: It's currently unsupported to use "export *" in a client boundary. Please use named exports instead.
    

Current vs. Expected behavior

The library uses 'use client' in a file that re-exports all exports from another file. This fails when it's in an installed module, but works in user code. You can verify this by flipping the comments in ./src/layout.tsx:

// import { Foo } from 'foo';
import { Foo } from './components';

As it works in user code, I'd expect this to work in library code as well.

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: Ubuntu 20.04.0 LTS Tue Jan 21 2025 10:24:28 GMT+0100 (Central European Standard Time)
    Binaries:
      Node: 18.20.3
      npm: 10.2.3
      Yarn: 1.22.19
      pnpm: 8.15.6
    Relevant Packages:
      next: 13.5.1
      eslint-config-next: 13.5.1
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.2.2
    Next.js Config:
      output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

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