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: "PostCSS configuration was not passed or is invalid" with svelte renderer #2273

Closed
Tc-001 opened this issue Dec 24, 2021 · 8 comments · Fixed by #2715 or #2807
Closed

🐛 BUG: "PostCSS configuration was not passed or is invalid" with svelte renderer #2273

Tc-001 opened this issue Dec 24, 2021 · 8 comments · Fixed by #2715 or #2807
Assignees

Comments

@Tc-001
Copy link
Contributor

Tc-001 commented Dec 24, 2021

What version of astro are you using?

0.22.1

What package manager are you using?

yarn

What operating system are you using?

Linux

Describe the Bug

When rendering a page with a svelte component, the following error will show (even if I am not using postcss) :

[svelte-preprocess] PostCSS configuration was not passed or is invalid. If you expect to load it from a file make sure to install "postcss-load-config" and try again.

Error: Cannot find module 'postcss-load-config'
Require stack:
- /sandbox/node_modules/svelte-preprocess/dist/transformers/postcss.js
- /sandbox/node_modules/svelte-preprocess/dist/autoProcess.js
- /sandbox/node_modules/svelte-preprocess/dist/index.js

This will not fail the build and the component seems to function as normal, but still floods the console.

Link to Minimal Reproducible Example

Astro.new svelte starter example (https://codesandbox.io/s/github/snowpackjs/astro/tree/latest/examples/framework-svelte)

@Tc-001
Copy link
Contributor Author

Tc-001 commented Dec 24, 2021

I could reproduce it on the starter, but it seems that after caching for the first time the error will not show.
Forking the sandbox starts a new instance and reproduces it (same with restarting from the server control panel)

@SteveALee
Copy link
Contributor

SteveALee commented Jan 1, 2022

Ditto but different config. I copied the svelte example diffs into minimal example

What version of astro are you using?
0.22.3

What package manager are you using?
npm

What operating system are you using?
WSL (in VS Code terminal)

@jonathantneal
Copy link
Contributor

Verified in 0.22.17

@ludwigschubert
Copy link

ludwigschubert commented Jan 23, 2022

Workaround

In Astro 0.22.17, adding "postcss-load-config": "^3.1.1" to devDependencies, and an effectively empty postcss.config.js file:

module.exports = {
  plugins: []
};

got rid of the warning for me. (+ I used the opportunity to learn about PostCSS and ended up adding the autoprefixer plugin to my project. \o/)

Link to Minimal Reproducible Example

https://codesandbox.io/s/sharp-breeze-j782n?file=/postcss.config.js
https://codesandbox.io/s/sharp-breeze-j782n?file=/package.json

@tony-sull tony-sull added bb:fix and removed bb:fix labels Feb 15, 2022
mxdvl added a commit to guardian/guardian-engineering-site that referenced this issue Mar 1, 2022
mxdvl added a commit to guardian/guardian-engineering-site that referenced this issue Mar 1, 2022
@natemoo-re natemoo-re assigned natemoo-re and unassigned matthewp Mar 3, 2022
@natemoo-re natemoo-re linked a pull request Mar 3, 2022 that will close this issue
@natemoo-re
Copy link
Member

natemoo-re commented Mar 3, 2022

Sorry this took so long! Should be fixed by #2715

@natemoo-re
Copy link
Member

Sorry y'all. Had to revert #2715 due to this change breaking some things in the new static build mode in astro 0.24. I'm hoping to (re)fix this ASAP.

@jonburger
Copy link

Probably doesn't help, but I'm experiencing the same issue today using:

0.24.0 / npm 7.20.3 / MacOS

@FredKSchott
Copy link
Member

Sorry about this one, yall!
FYI a short-term fix that you can run for this was outlined here:

1. `npm install postcss-load-config`
2. `echo "module.exports = {}" > postcss.config.js`

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