stackblitz / webcontainer-core

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

Build command does not work on webcontainer #1462

Open LunaticMuch opened 3 months ago

LunaticMuch commented 3 months ago

Describe the bug

For some weird reason, my build command stops gracefully without any error but also without running

~/LunaticMuch/fuzzy-giggle main 7s
❯ npm run build

> @example/starlight-tailwind@0.0.1 build
> astro build

09:31:46 [types] Added src/env.d.ts type declarations.

~/LunaticMuch/fuzzy-giggle main 12s
❯ echo $?
0

Link to the blitz that caused the error

https://stackblitz.com/~/github.com/LunaticMuch/fuzzy-giggle?file=logs/stackblitz/astro.info.out:L1-L8

Steps to reproduce

  1. Open the webcontainer
  2. run npm run build

Expected behavior

If you look for my local build in ./logs/macos/build.out you will notice there's a build output....something "more"

Parity with Local

Screenshots

No response

Platform

Version = 1.84.0
Hash = 5f55b358bd53b196a59d6d290be4ab842509ed00
WebContainer = c3e5e364

Browser name  = Chrome
Full version  = 125.0.0.0
Major version = 125
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 77500081,
  "usedJSHeapSize": 64945921,
  "jsHeapSizeLimit": 4294705152
}

Additional context

I tried already the clean cache and clean everything with no luck. The same container was working few hours ago, but I noticed already yesterday sometimes I need to run the command twice or three times to get a complete output.

SamVerschueren commented 3 months ago

Hey @LunaticMuch 👋 ! Thanks for reporting the issue.

We noticed this as well and have an issue with astro somewhere. We already spent time looking into it but it's very hard to debug. For some bizar reason, it might help to rename astro.config.mjs to astro.config.ts. I tried that with your repository, and it seems to "fix" it. I can't explain why that is though.

We already have an internal ticket to track this, I'll link this issue to it.