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

🐛 BUG: CSS modules not bundled in built sites if using client:only vue components imported via alias #3199

Closed
1 task
songololo opened this issue Apr 24, 2022 · 9 comments
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@songololo
Copy link

What version of astro are you using?

1.0.0-beta.17

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Mac

Describe the Bug

CSS modules not bundled when building sites if using client:only vue components imported via alias

This is a similar issue to existing (closed) issues where CSS modules imported to client:only vue (or other) components are ignored when building a site:

These issues are now resolved and closed, however, the issue still arises when importing a component via an alias.

For example:

  • It works when using import Counter from '../components/Counter.vue';
  • But not when using import Counter from '@src/components/Counter.vue';

Note - this issue is not a problem in development mode, so you have to build then preview the site to see the problem in action.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-fwoavp-wvrbax

Participation

  • I am willing to submit a pull request for this issue.
@songololo songololo changed the title 🐛 BUG: CSS modules not bundled when building sites if using vue components imported via alias 🐛 BUG: CSS modules not bundled in built sites if using client:only vue components imported via alias Apr 24, 2022
@pmochine
Copy link

Probably related to #2575 as well

@jasikpark
Copy link
Contributor

jasikpark commented May 4, 2022

I'm having the same problem w/ <Carousel client:only/> in React when Carousel.tsx imports CSS - it seems that since only the astro root is added and none of the other assets, the CSS doesn't get included in the bundle. The dev server works fine for it though.

currently v0.26.1

@FredKSchott
Copy link
Member

FredKSchott commented May 10, 2022

I can confirm on the latest v1.0.0-beta as well. This is only client:only, and not any other client:* that I tested. More investigation needed.

@FredKSchott FredKSchott added - P4: important Violate documented behavior or significantly impacts performance (priority) s1-small labels May 10, 2022
@matthewp
Copy link
Contributor

This is caused by an upstream bug: rollup/plugins#1190. Tracking that and can follow-up when it's complete.

@matthewp
Copy link
Contributor

Appears to still be happening: https://stackblitz.com/edit/github-fwoavp-hrx2y2?file=package.json

@matthewp matthewp removed their assignment Aug 30, 2022
@matthewp
Copy link
Contributor

@bluwy this might be fixed by that new resolution idea we discussed. Assigning to you, but this can be checked after the refactor.

@bluwy
Copy link
Member

bluwy commented Sep 21, 2022

Looks like this is fixed in Astro 1.2.0, #4699

@bluwy bluwy closed this as completed Sep 21, 2022
@stefanullinger
Copy link

I am still seeing a similar issue in Astro 1.6.0 and @astrojs/react 1.2.2. After deploying to Vercel the components are displayed unstyled in the browser.

@joechipjoechip
Copy link

Using version 4.0.6 and the issue is still there .. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

No branches or pull requests

8 participants