-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Labels
bugSomething that isn't workingSomething that isn't workingvitestRelating to the Workers Vitest integrationRelating to the Workers Vitest integration
Description
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 with vitest the error is displayed on the console.
FAIL test/index.spec.ts [ test/index.spec.ts ]
Error: No such module "Users/elct9620/Workspace/StarPortal/line-bot-testing-lab/node_modules/axios/lib/platform/node/classes/url".
imported from "Users/elct9620/Workspace/StarPortal/line-bot-testing-lab/node_modules/axios/lib/platform/node/classes/URLSearchParams.js"
Use
wrangler deployand works correctly in the CloudFlare
Expected behavior
The test should passed.
Steps to reproduce
Please provide the following:
npm init cloudflare
- Enable TypeScript
- Enable git
- Don't deploy
npm i -D axios- Add
import axios from 'axios'to the header insrc/index.ts - Add
axios.get('https://example.com')to the handler insrc/index.ts
The
axiosis required by SDK (https://github.com/line/line-bot-sdk-nodejs) everything is default from the template.
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
workerd/server/server.c++:2835: error: Fallback service failed to fetch module; payload = ; spec = /?specifier=%2Fprivate%2Ftmp%2Fcf-axios%2Fnode_modules%2Faxios%2Flib%2Fplatform%2Fnode%2Fclasses%2Furl&referrer=%2Fprivate%2Ftmp%2Fcf-axios%2Fnode_modules%2Faxios%2Flib%2Fplatform%2Fnode%2Fclasses%2FURLSearchParams.js&rawSpecifier=url
❯ test/index.spec.ts (0)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL test/index.spec.ts [ test/index.spec.ts ]
Error: No such module "private/tmp/cf-axios/node_modules/axios/lib/platform/node/classes/url".
imported from "private/tmp/cf-axios/node_modules/axios/lib/platform/node/classes/URLSearchParams.js"
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
Test Files 1 failed (1)
Tests no tests
Start at 18:23:16
Duration 0ms
FAIL Tests failed. Watching for file changes...
press h to show help, press q to quit
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that isn't workingSomething that isn't workingvitestRelating to the Workers Vitest integrationRelating to the Workers Vitest integration
Type
Projects
Status
Done