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

Vite-Node Import of '@js-temporal/polyfill' Is Undefined #902

Closed
6 tasks done
stolinski opened this issue Mar 6, 2022 · 1 comment · Fixed by #924
Closed
6 tasks done

Vite-Node Import of '@js-temporal/polyfill' Is Undefined #902

stolinski opened this issue Mar 6, 2022 · 1 comment · Fixed by #924

Comments

@stolinski
Copy link

Describe the bug

Importing this package works fine with Vite, Node and other environments but comes in as undefined with Vite-node / Vitest.

optimizeDeps has no impact as well.

I looked through https://github.com/js-temporal/temporal-polyfill/blob/main/package.json but nothing stood out as being unusual, so I'm a bit lost as to why this import specifically fails.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-2aqiqv?file=test/basic.test.ts

System Info

System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 6.84 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v17.0.1/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v17.0.1/bin/npm
  Browsers:
    Chrome: 99.0.4844.51
    Firefox: 95.0.2
    Firefox Developer Edition: 97.0
    Safari: 15.2
  npmPackages:
    vitest: ^0.5.9 => 0.5.9

Used Package Manager

pnpm

Validations

@sheremet-va
Copy link
Member

This is fixed by #924

In the meantime you can use deps.external:

{
  deps: {
    external: [/@js-temporal/]
  }
}

@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.

2 participants