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

Browser fail to work with pnpm #3380

Closed
6 tasks done
christophe-g opened this issue May 16, 2023 · 1 comment
Closed
6 tasks done

Browser fail to work with pnpm #3380

christophe-g opened this issue May 16, 2023 · 1 comment
Labels
feat: browser Issues and PRs related to the browser runner pr welcome

Comments

@christophe-g
Copy link

christophe-g commented May 16, 2023

Describe the bug

running vitest in browser mode fail when dependencies are installed via pnpm

Reproduction

cloning this test repo and install with pnpm

> git clone git@github.com:frank-weindel/vitest-3286-browser-typescript.git
> cd vitest-3286-browser-typescript
> pnpm i
> pnpm up -L
> pnpm test:browser

The browser console complains with :

Uncaught (in promise) SyntaxError: The requested module '/node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/index.js?v=968211a6' does not provide an export named '__vi_inject__' (at index.js?v=968211a6:3:10)

Doing the same unde nmp works (just need to remove the optimizeDeps in vite.conf.js when running with latest vite and vitest)

Potentiall linked issues: #3124

System Info

System:
    OS: Linux 5.15 Linux Mint 21.1 (Vera)
    CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
    Memory: 2.25 GB / 7.66 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
    npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
  Browsers:
    Chrome: 113.0.5672.92
    Firefox: 113.0
  npmPackages:
    @vitest/browser: ^0.31.0 => 0.31.0 
    vite: ^4.3.6 => 4.3.6 
    vitest: ^0.31.0 => 0.31.0

Used Package Manager

pnpm

Validations

@sheremet-va sheremet-va added bug pr welcome feat: browser Issues and PRs related to the browser runner labels May 17, 2023
@sheremet-va
Copy link
Member

Duplicate of #3363

@sheremet-va sheremet-va marked this as a duplicate of #3363 May 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: browser Issues and PRs related to the browser runner pr welcome
Projects
None yet
Development

No branches or pull requests

2 participants