Open elct9620 opened 2 months ago
Is there a workaround to resolve this issue?
Faced the same issue with langchain js. Vitest fails, wrangler dev works fine
Error: No such module "./node_modules/@langchain/core/dist/runnables/uuid". imported from "./node_modules/@langchain/core/dist/runnables/base.js"
Thanks very much for reporting this. I've reproduced the bug and added the issue to our backlog for work.
For anyone who ends up picking up this ticket, what seems to be happening here is that workerd
cannot resolve the module, so it is requesting it from our "fallback service", whose job it is to find that module and return it. This could, therefore, be a bug in the node-like module resolution in the fallback service.
is there any update? I have the same issue.
Using vars defined in .dev.vars
[vpw:inf] Starting single runtime for vitest.config.mts...
workerd/server/server.c++:2835: error: Fallback service failed to fetch module; payload = ; spec = /?specifier=%2FUsers%2Fderek%2FWorkspaces%2Fagent%2Fnode_modules%2Fuuid%2Fdist%2Fesm-browser%2Findex.js&referrer=%2FUsers%2Fderek%2FWorkspaces%2Fagent%2Fnode_modules%2F%40langchain%2Fcore%2Fdist%2Frunnables%2Fbase.js&rawSpecifier=uuid
Which Cloudflare product(s) does this pertain to?
Workers Vitest Integration
What version(s) of the tool(s) are you using?
3.63.1 [Wrangler], 0.4.9 [@cloudflare/vitest-pool-workers], 1.5.3 [vitest]
What version of Node are you using?
20.12.2
What operating system and version are you using?
Mac Sonoma 14.4.1
Describe the Bug
Observed behavior
When running
npm run test
withvitest
the error is displayed on the console.Expected behavior
The test should passed.
Steps to reproduce
Please provide the following:
npm init cloudflare
npm i -D axios
import axios from 'axios'
to the header insrc/index.ts
axios.get('https://example.com')
to the handler insrc/index.ts
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs