-
Notifications
You must be signed in to change notification settings - Fork 93
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
NcButton styles missing in bundler output in 8.12 #5719
Comments
I sort of found the problem, which is apparently not caused by @nextcloud/vue directly. The observed behavior is just a symptom. My application has multiple entry points. One of them is the main application from which the screenshots were taken. Another one is a plugin for the files application which shares some dependencies with the main application. Vite splits common code into separate files which will be loaded automatically. This usually works fine. One of those shared dependencies is @nextcloud/dialogs which both entry points use for toasts. After removing all references to this package from the files plugin, the main application displays correctly. In fact, the problem can be reproduced by any additional entry point as simple as import { showError } from "@nextcloud/dialogs"
showError('boo') Using both packages in a single entry point does not cause problems. I suspect the root cause is with @nextcloud/dialogs, which acts weirdly regarding bundling, tree shaking and code splitting. I'm leaving this issue open in case you plan to make the package immune to interference (up to 8.11.3, this was not a problem). |
Hi @hschletz This is probably a Vite's bug. We have just created a Vite plugin in our nextcloud-libraries/nextcloud-vite-config#204 It is to be released very soon. |
After updating from 8.11.3 to 8.12, NcButton components in my app lack styling when built via "vite build" or "vite watch":
The CSS rules for the ".button-vue" selectors are missing. Output from "vite dev" is correct, and the rules exist:
Downgrading to 8.11.3 temporarily fixes the problem.
Here's the vite.config.ts I used for the screenshot:
The text was updated successfully, but these errors were encountered: