-
Notifications
You must be signed in to change notification settings - Fork 202
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
Build fails when using a dynamic css import #896
Comments
Same issue, any fix available? |
this is a workaround, use import cssFile from "@/assets/cs.css?raw";
const style = document.createElement("style");
style.textContent = cssFile;
document.head.append(style); |
Thanks for contributing to CRXJS! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days. |
Yes, that is the current solution I'm using, however, you don't get hot reloading with css then. My current solution was just to add an if statement checking whether it was in dev mode and applying it accordingly. |
This is an automated message. Please do not reply to this comment. |
Build tool
Vite
Where do you see the problem?
Describe the bug
For some reason, when I use the dynamic import for my scss file
import('./css/injected.scss')
it loads beautifully when I run the dev script, but on build it fails. I know this isn't isolated to my machine as the same error was experienced by the github CI/CD actions I have setup.Reproduction
In order to reproduce, you can clone my chrome extension: https://github.com/BetterSEQTA/BetterSEQTA-Plus
Then
git checkout 6289bcec
to go to the commit where it's broken. The main file is SEQTA.ts in src, on line 67 it imports the scss file. This problem is still present when converting over and only importing a regular css file...Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: