Skip to content

Commit

Permalink
Fix: add "CSS" to noExternal hint (#3426)
Browse files Browse the repository at this point in the history
* chore: add "CSS" to noExternal hint

* chore: changeset
  • Loading branch information
bholmesdev authored May 24, 2022
1 parent 4e3b405 commit 946630a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/blue-bottles-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Logs: Add "ssr.noExternal" hint for CSS loaded from npm packages
2 changes: 1 addition & 1 deletion packages/astro/src/core/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const incompatiblePackages = {
const incompatPackageExp = new RegExp(`(${Object.keys(incompatiblePackages).join('|')})`);

function generateHint(err: ErrorWithMetadata): string | undefined {
if (/Unknown file extension \"\.(jsx|vue|svelte|astro)\" for /.test(err.message)) {
if (/Unknown file extension \"\.(jsx|vue|svelte|astro|css)\" for /.test(err.message)) {
return 'You likely need to add this package to `vite.ssr.noExternal` in your astro config file.';
} else {
const res = incompatPackageExp.exec(err.stack);
Expand Down

0 comments on commit 946630a

Please sign in to comment.