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

Can't import data URI #822

Closed
6 tasks done
mgibas opened this issue Feb 21, 2022 · 0 comments · Fixed by #823
Closed
6 tasks done

Can't import data URI #822

mgibas opened this issue Feb 21, 2022 · 0 comments · Fixed by #823

Comments

@mgibas
Copy link

mgibas commented Feb 21, 2022

Describe the bug

Vite support data URI imports but it fails while running inside a test:

it('dataURI imports properly', async () => {
  const dataUri = 'data:text/javascript;charset=utf-8,export default "hi"'
  expect(await import(dataUri)).toEqual({ default: 'hi' })
})

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-6tetb6

System Info

System:
    OS: macOS 12.2.1
    CPU: (8) arm64 Apple M1
    Memory: 383.91 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.5.0 - /opt/homebrew/bin/node
    npm: 8.4.1 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 98.0.4758.102
    Firefox: 93.0
    Safari: 15.3

Used Package Manager

pnpm

Validations

@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 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.

1 participant