-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
feat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runnerp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
When executing the tests, each test fails because of TypeError: __vi_esm_0__.default is not a function.
After reducing it to the minimal reproducible example, I could isolate that the issue is the package pino.
You can find "working" tests here src/browser/working.spec.ts
The mocking does not work, but this is besides this bug
But the same code that uses pino is not able to load it: src/browser/logger.spec.ts
Reproduction
git clone https://github.com/NicoVogel/logger-wrappergit checkout bug/vitest-browser-vi-esm-0-default-not-a-function- (optional) reopen in dev container
pnpm installcd packages/loggerpnpm exec vitest -c vitest.browser.ts
System Info
System:
OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-1340P
Memory: 24.36 GB / 31.05 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
pnpm: 8.6.12 - ~/.nvm/versions/node/v18.17.1/bin/pnpm
Browsers:
Chrome: 116.0.5845.140
npmPackages:
@vitest/browser: ^0.34.1 => 0.34.1Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runnerp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)