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

Explicit import from #component of .client components throws an error server side #14755

Closed
huang-julien opened this issue Aug 30, 2022 · 1 comment · Fixed by nuxt/framework#7412

Comments

@huang-julien
Copy link
Member

Environment


  • Operating System: Linux
  • Node Version: v16.15.0
  • Nuxt Version: 3.0.0-rc.8
  • Package Manager: yarn@3.2.3
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-ewymne?file=app.vue,components%2FHello.client.vue

Describe the bug

Hi 👋 I ran into this issue when trying to import a client only component with an explicit import

import { Hello } from "#components"

However it seems that a .server component fallback is mandatory for Nuxt server-side, I can workaround this by adding a Hello.server.vue but i don't think that this is an expected behavior.

Calling the component without specifying the import works.

Additional context

No response

Logs

No response

@huang-julien
Copy link
Member Author

huang-julien commented Sep 3, 2022

Not sure if this should be in a separate issue
https://stackblitz.com/edit/github-ewymne-tuweve?file=app.vue,components%2FHello.server.vue
adding a .server fallback and explicitly importing the component resultin a hydration mismatch

EDIT: my bad, explicit imports does not work even with #components. @danielroe Are .client.vue components supposed to be converted with createClientOnly when importing from #components ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants