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

"TypeError: vi_esm_1.default.default is not a function" error when an expect assertion failed on browser mode #3625

Closed
6 tasks done
Bnaya opened this issue Jun 19, 2023 · 5 comments · Fixed by #3627
Closed
6 tasks done
Milestone

Comments

@Bnaya
Copy link

Bnaya commented Jun 19, 2023

Describe the bug

There's a wacked "TypeError: vi_esm_1.default.default is not a function" error when an expect assertion failed on browser mode

Run this code in browser mode:

describe("vitest browser mode lets see", function () {
  test("lalla", async () => {
    expect(1).toBe(1);
    expect(1).toBe(2); // <- Failed assertion
  });
});

Reproduction

Not working on stackblitz!
https://stackblitz.com/edit/vitest-dev-vitest-cupgmf

System Info

System:
    OS: macOS 13.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 5.30 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.14.0 - ~/.volta/tools/image/node/18.14.0/bin/node
    Yarn: 3.2.0 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 9.3.1 - ~/.volta/tools/image/node/18.14.0/bin/npm
  Browsers:
    Chrome: 114.0.5735.133
    Chrome Canary: 116.0.5841.0
    Firefox: 112.0.2
    Safari: 16.5
  npmPackages:
    vitest: ^0.32.0 => 0.32.0

Used Package Manager

npm

Validations

@stackblitz
Copy link

stackblitz bot commented Jun 19, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@atmosbear
Copy link

Hi there, I'm still getting this issue: TypeError: __vi_esm_1__.default.default is not a function

Is it fully fixed? If it is I'll do some testing and start over from scratch to see if I need to make a new issue

@sheremet-va
Copy link
Member

Fix is not released yet

@atmosbear
Copy link

Aww man. Is there a way to build it myself so that I can use it? It's really hard to do browser testing with it haha

@Bnaya
Copy link
Author

Bnaya commented Jun 30, 2023

Aww man. Is there a way to build it myself so that I can use it? It's really hard to do browser testing with it haha

If you are very inpatient, I would recommend using some form of package patching and not deal with publishing

@github-actions github-actions bot locked and limited conversation to collaborators Jul 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants