Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Tailwind & PostCSS error when adding Svelte to an Astro project

$
0
0

I have been using Astro with Tailwind for a project, however upon adding Svelte to the project with a simple npx astro add svelte, a simple npm run dev produces this error:

error   Cannot read properties of undefined (reading 'postcss')  File:    C:\Users\**\node_modules\@astrojs\tailwind\dist\index.js:78:22  Code:    77 |         const tailwindConfig = (userConfig == null ? void 0 : userConfig.value) ?? getDefaultTailwindConfig(config.srcDir);> 78 |         config.style.postcss.plugins.push(tailwindPlugin(tailwindConfig));         |                      ^      79 |         config.style.postcss.plugins.push(autoprefixerPlugin);      80 |         if (applyBaseStyles) {      81 |           injectScript("page-ssr", `import '@astrojs/tailwind/base.css';`);  Stacktrace:TypeError: Cannot read properties of undefined (reading 'postcss')    at astro:config:setup (file:///C:/Users/**/node_modules/@astrojs/tailwind/dist/index.js:78:22)    at async withTakingALongTimeMsg (file:///C:/Users/**/node_modules/astro/dist/integrations/index.js:18:18)    at async runHookConfigSetup (file:///C:/Users/**/node_modules/astro/dist/integrations/index.js:95:7)    at async createContainer (file:///C:/Users/**/node_modules/astro/dist/core/dev/container.js:30:14)    at async createContainerWithAutomaticRestart (file:///C:/Users/**/node_modules/astro/dist/core/dev/restart.js:90:28)    at async dev (file:///C:/Users/**/node_modules/astro/dist/core/dev/dev.js:32:19)    at async runCommand (file:///C:/Users/**/node_modules/astro/dist/cli/index.js:155:7)    at async cli (file:///C:/Users/**/node_modules/astro/dist/cli/index.js:213:5)

I have tried a few workarounds like creating a postcss.config.js file, however it hasn't yielded any results.

Would appreciate any insights on what may be causing this issue and any suggestions for fixing it.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>