-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
waku processes .test.ts
files during development, causing issues with bun:test
#1264
Comments
Thanks for reporting! The possible causes sound like a good hint. Would anyone like to dig into it? |
I might be able to take a look at this sometime this week! |
Oddly, I don't see this error:
When trying to replicate this issue. I created a reproduction repo here: https://github.com/hamlim/waku-bun-test-bug-reproduction The app seemed to work fine in dev mode when the test file was only within @mrsekut could you possibly create a simplified reproduction and share it? (or see what might be different between mine linked above and yours?) |
@scottykaye and I were looking into this issue the other day, but haven't made much progress, outlining the things we've tried here in case others have any ideas!
Our hunch is that we want to configure any vite process to ignore any Maybe there are plugins that are implicitly including Short term also - I think if the test file is moved to an |
Just to confirm, is this dev only issue? aka |
I haven't tested |
I ran it using both dev and build commands and the issue persists for both environments. |
Sorry for the delayed response—I didn’t notice the mention earlier. I tried creating a new waku project from scratch, and I couldn't reproduce the issue in that case. However, when I tested the original project where the bug occurred, I was still able to reproduce the issue. To help with debugging, I stripped down the problematic project to a minimal reproducible example: Steps to reproduce:
The bug still occurs in this setup. I haven’t yet investigated the exact differences between this and a fresh project, but this might help in pinpointing the root cause. |
Description
While using
waku
withbun
, I noticed that.test.ts
files are being processed when runningbun run dev
. This leads to an error if the test files usebun:test
, as Vite attempts to resolve it during import analysis.However, test files are typically not needed during runtime and should not be loaded in the first place. This behavior suggests that
vite
is unintentionally including.test.ts
files when resolving dependencies.This is not a critical issue, as switching from
bun:test
tovitest
resolves the problem. I wanted to share this behavior in case it is unintended and might be worth addressing.Steps to Reproduce
waku
+bun
project, create a test file (e.g.,sample.test.ts
):Expected Behavior
.test.ts
files should not be processed during development server startup, as they are only needed in test environments.vite
should not attempt to resolvebun:test
during theimport-analysis
phase.Possible Causes
vite
'soptimizeDeps.entries
might be unintentionally including.test.ts
files.processModule
function indev-server-impl.js
could be processing.test.ts
files when it shouldn't.willBeHandled
logic might not be properly filtering out.test.ts
files.Additional Notes
vitest
instead ofbun:test
resolved the issue, so this is not blocking my work.Let me know if you need any more details. Thanks!
The text was updated successfully, but these errors were encountered: