-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Labels
feat: ssrp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)wontfixThis will not be worked onThis will not be worked on
Description
Describe the bug
vite.ssrLoadModule
will stuck when importing a npm package which exports a unresolved thenable (like unenv/runtime/mock/proxy
). And it throws when the npm package exports a real promise:
3:16:09 PM [vite] Error when evaluating SSR module /src/main.js:
TypeError: Method Promise.prototype.then called on incompatible receiver [object Module]
at Proxy.then (<anonymous>)
node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^
TypeError: Method Promise.prototype.then called on incompatible receiver [object Module]
at Proxy.then (<anonymous>)
Reproduction
https://github.com/gzzhanghao/vue-promise-issue
System Info
Binaries:
Node: 16.15.1
Yarn: 1.22.17
npm: 8.11.0
npmPackages:
vite: ^2.9.12 => 2.9.12
Used Package Manager
yarn
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
feat: ssrp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)wontfixThis will not be worked onThis will not be worked on