stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.86k stars 156 forks source link

Sveltekit and PostCSS - Error when evaluating SSR module #587

Open Kohlenbach opened 2 years ago

Kohlenbach commented 2 years ago

Describe the bug

I have some errors when importing a private project from github (sveltekit, tailwind, vite ...); Looks like the bug is something related to the runtime with vite, that don't load the tailwind JIT, or just the postCSS configuration.

Link to the blitz that caused the error

https://stackblitz.com/edit/sveltejs-kit-template-default-ud2nz4

Steps to reproduce

  1. Run dev script yarn dev;
  2. Navigate to the index page;
  3. Look to the terminal for more info about the bug.

Expected behavior

Expected to load the page with the generated classes from tailwind library.

Parity with Local

Screenshots

image image

Platform

Additional context

So, to try to solve the bugs by myself I created this new public project and look for what it could be. I checked if there could be any dependencies that wouldn't work with the webcontainer, but that doesn't seem to be the case. This code run normal in local. I have seen others stackblitz projects working with tailwind (like nextjs), but not with vite. The error just came when I put the postcss config file (where the vite loads auto). Tried to seach about what could be in exists issues and my friend google, but no luck. Thanks for read! And any information or help needed, I will enjoy to help.

HeyGarrison commented 2 years ago

@Kohlenbach I'm not exactly sure what is going on here, but here is a project that works: https://stackblitz.com/edit/sveltejs-kit-template-default-e2uxyk?file=package.json&terminal=dev

Does that help resolve this for you? Feel free to fork, etc.

SamVerschueren commented 1 year ago

It does look like there's an issue when it tries to resolve the postcss.config.cjs file. Which is weird because it definitely exists on disk. I created a ticket internally to take a closer look.

kirjavascript commented 1 year ago

Hi there!

We are still looking to this issue but in the meantime upgrading sveltekit fixes the issue.

Here's a working fork of your project with some slightly tweaked version numbers: https://stackblitz.com/edit/sveltejs-kit-template-default-9mbwre