This error is generated from a fresh astro project
npm init astro my-app
then add svelte and tailwind
npx astro add tailwind
npx astro add svelte
in a svelte file add a <script> section and add tailwind @apply styles that use a selector e.g. hover: and this error is thrown
Is this a bug that should issued in github? or maybe i missed something in the doc?
#Error: Semicolon or block is expected
3 messages · Page 1 of 1 (latest)
it works if i create the file postcss.config.js file with:
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
and use <style lang="postcss"> in svelte files
ive done more work and it appears to be a bug
here is an update to what I said above:
1 - create the fresh project as stated in the original post
2 - in order to make it work, ALL i needed to add was lang="css" to the style tag (i.e. <style lang="css"> ) to the svelte file, so does this indicate we need to update @astrojs/svelte to track changes in @sveltejs/vite-plugin-svelte ?
3 - VS Code still generates errors for those : selectors (e.g. hover:). Creating the above postcss.config.js file made VS Code happy 🙂