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

kv.listenQueue prevents build mode from working #2240

Open
marvinhagemeister opened this issue Jan 11, 2024 · 3 comments
Open

kv.listenQueue prevents build mode from working #2240

marvinhagemeister opened this issue Jan 11, 2024 · 3 comments
Labels
bug Something isn't working.

Comments

@marvinhagemeister
Copy link
Collaborator

The kv.listenQueue() function prevents the process from exiting because it waits for messages forever. This breaks the build command.

We should probably add something similar to IS_BROWSER like IS_BUILD_MODE or something so that users can exclude long running stuff from being executed during build.

Another approach would be to avoid importing user code during build. Off the top of my head I think we only import user code during build for the manifest generation. Maybe we should replace that with AST-based logic. That way user's don't need to add conditionals or anything to their code.

@marvinhagemeister marvinhagemeister added the bug Something isn't working. label Jan 11, 2024
@mcgear
Copy link
Contributor

mcgear commented Jan 11, 2024

I was just trying to figure out a workaround for this, until we get something going in the framework. Any thoughts?

@mcgear
Copy link
Contributor

mcgear commented Jan 11, 2024

For now, i have settled on managing a second dev.build.ts file that just doesn't import my handlers, and that seems to be working.

@marvinhagemeister
Copy link
Collaborator Author

A workaround is to check if Fresh is running in build mode and then skipping the logic. Something like:

if (!Deno.args.includes("build")) {
  somethingThatShouldNotRunDuringBuild();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
2 participants