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

[🐞] Can't build with bun #7051

Closed
svi3c opened this issue Nov 8, 2024 · 4 comments
Closed

[🐞] Can't build with bun #7051

svi3c opened this issue Nov 8, 2024 · 4 comments
Assignees
Labels
STATUS-3: solved by V2 This issue is solved by the next major version of Qwik

Comments

@svi3c
Copy link

svi3c commented Nov 8, 2024

Which component is affected?

Qwik Optimizer (rust)

Describe the bug

I want to build with bun.
When I run bun -b build or bun -b preview, it builds fine, but I get an error when running the built app.
image

Reproduction

https://qwik.dev/docs/getting-started/#create-an-app-using-the-cli

Steps to reproduce

  1. Create a qwik app via bun create qwik@latest
  2. Within the app directory run bun -b preview

System Info

System:
    OS: macOS 15.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 214.89 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    Yarn: 4.1.1 - ~/.volta/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    bun: 1.1.34 - ~/.bun/bin/bun
  Browsers:
    Chrome: 130.0.6723.117
    Safari: 18.1
  npmPackages:
    @builder.io/qwik: ^1.9.1 => 1.9.1
    @builder.io/qwik-city: ^1.9.1 => 1.9.1
    typescript: 5.4.5 => 5.4.5
    undici: * => 6.20.1
    vite: 5.3.5 => 5.3.5

Additional Information

When building with NodeJS (having it installed and erasing the -b flag), it works.
But this way, I cannot use the Bun APIs at build / SSG time and I cannot build it in one go via my Bun monorepo.

@svi3c svi3c added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Nov 8, 2024
@damianpumar
Copy link
Contributor

damianpumar commented Nov 25, 2024

After looking into it, I found that by removing this script, the compilation works correctly. Now, I need to understand what is happening.

https://github.com/QwikDev/qwik/blob/a1b44df6b21feec3e98b6c0c8ea582e1bcd82127/packages/qwik-city/src/runtime/src/router-outlet-component.tsx#L40C11-L59C21

Even if you comment this single line it works:
document:onQCInit$={spaInit}

I will be working to try to fix it.

@damianpumar
Copy link
Contributor

@gioboa discovered that it works correctly with version bun create qwik@2.0.0-alpha.1. For this reason, I think we can close this issue, as version 2 will be released soon.

@gioboa gioboa added STATUS-3: solved by V2 This issue is solved by the next major version of Qwik and removed TYPE: bug Something isn't working STATUS-1: needs triage New issue which needs to be triaged labels Nov 27, 2024
@gioboa
Copy link
Member

gioboa commented Nov 27, 2024

@damianpumar Thanks for your help 👏

@gioboa gioboa closed this as completed Nov 27, 2024
@svi3c
Copy link
Author

svi3c commented Nov 27, 2024

Great, thanks for your investigation, @damianpumar
Now I'm even more excited about the 2.0 release :)

@gioboa gioboa self-assigned this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-3: solved by V2 This issue is solved by the next major version of Qwik
Projects
None yet
Development

No branches or pull requests

3 participants