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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悶] pnpm run build hang when i use ioredis and bullmq #5856

Open
koisose opened this issue Feb 16, 2024 · 3 comments
Open

[馃悶] pnpm run build hang when i use ioredis and bullmq #5856

koisose opened this issue Feb 16, 2024 · 3 comments
Labels
COMP: optimizer TYPE: bug Something isn't working

Comments

@koisose
Copy link

koisose commented Feb 16, 2024

Which component is affected?

Qwik Runtime

Describe the bug

continuing from this message https://discord.com/channels/842438759945601056/1070624203583262721/1208074251815358496 im trying to build my qwik app that uses bullmq to process a screenshot, and it hangs when i try to build it for production, i fix it by putting all the connection inside closure that way it doesnt start connection immediately this is my code when the build hangs:

https://gist.github.com/koisose/f4ff6f4a92c0451dd934372972e675a2

and then this is how i change it so it doesnt hang

https://gist.github.com/koisose/57e908ad50a910a561addd95dd287340

it quite hacky but it works

Reproduction

https://github.com/koisose/qwik-error-build

Steps to reproduce

first you need to change https://github.com/koisose/qwik-error-build/blob/main/src/utils/bullmq/config.ts to your own redis instance config you can use upstash

then if you want to see the error run pnpm run build it will hang like this:

image

System Info

System:
    OS: Linux 5.4 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (4) x64 Intel(R) Xeon(R) Platinum 8167M CPU @ 2.00GHz
    Memory: 21.61 GB / 29.09 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 21.6.1 - ~/.local/state/fnm_multishells/16556_1708123451816/bin/node
    npm: 10.2.4 - ~/.local/state/fnm_multishells/16556_1708123451816/bin/npm
    pnpm: 8.15.2 - ~/.local/share/pnpm/pnpm
  npmPackages:
    @builder.io/qwik: ^1.4.4 => 1.4.4 
    @builder.io/qwik-city: ^1.4.4 => 1.4.4 
    @builder.io/qwik-react: 0.5.0 => 0.5.0 
    undici: * => 6.6.2 
    vite: ^5.0.12 => 5.1.1

Additional Information

No response

@koisose koisose added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Feb 16, 2024
@koisose koisose changed the title [馃悶] pnpm run build error when i use ioredis and bullmq [馃悶] pnpm run build hang when i use ioredis and bullmq Feb 17, 2024
@wmertens wmertens added COMP: optimizer and removed STATUS-1: needs triage New issue which needs to be triaged labels Feb 17, 2024
@wmertens
Copy link
Member

It would be great if we could get a minimal repro of this. It doesn't need to be a working app, just the minimal source that causes the optimizer to hang.

@koisose
Copy link
Author

koisose commented Feb 17, 2024

It would be great if we could get a minimal repro of this. It doesn't need to be a working app, just the minimal source that causes the optimizer to hang.

yes sir heres the repro link https://github.com/koisose/qwik-error-build just run:

pnpm i
pnpm run build

and i also include the fix here https://github.com/koisose/qwik-error-build/blob/main/src/utils/bullmq/queue-fix.ts this is not optimal i know but it is enough for my use case

@saeedhbi
Copy link

saeedhbi commented Mar 5, 2024

I accidentally stumbled upon an issue. I was developing with Ubuntu v20, and everything was working fine. However, when I switched to Ubuntu 22.04, the server build process would not end execution. I couldn't figure out the problem, but it seems that the Qwik server build process executes the code at the build time to create necessary pages. During execution, it tries to resolve dependencies, but, weirdly, it can't resolve ioredis and bullmq. Although, if the build.server command exits at the end, there is no problem running the application.

But in the end, this happens only when the ssg flag is not disabled on the server adapter. If it is null, since the server build is not trying to create static pages, there is no hanging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP: optimizer TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants