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

Vitest v24+ appears to break some default exports #2509

Closed
6 tasks done
kyle-sawatsky opened this issue Dec 14, 2022 · 1 comment · Fixed by #2512
Closed
6 tasks done

Vitest v24+ appears to break some default exports #2509

kyle-sawatsky opened this issue Dec 14, 2022 · 1 comment · Fixed by #2512

Comments

@kyle-sawatsky
Copy link

Describe the bug

While upgrading to Vite 4 I also needed to upgrade vitest which was at 0.23.4.

Upgrading to any version of 0.24.x appears to break imports of modules that use a default export. I personally encountered this with react-dropzone and react-router-navigation-prompt.

Reproduction

This stackblitz (https://stackblitz.com/edit/github-w9fjy7-juwvvx) has vitest at 0.23.4 and it renders the dropzone.

This one (https://stackblitz.com/edit/github-w9fjy7-9uzxfy) fails because the import from react-dropzone ends up being an object, not the functional component. The only different is vitest at 0.24.4

I am not an expert in all the clashes with different module types etc. but the changelog doesn't seem to indicate that this would be an issue.

System Info

System:
    OS: macOS 12.6.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 1.17 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.98
    Safari: 16.2
  npmPackages:
    @vitejs/plugin-react: ^3.0.0 => 3.0.0 
    vite: ^4.0.0 => 4.0.1 
    vitest: ^0.24.4 => 0.24.4

Used Package Manager

npm

Validations

@charles-stuart-appdetex

I'm seeing this with named exports. Using 0.23.4 solves the issue.

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