-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Describe the bug
Hello
When i started dev server i got some errors like "TypeError: CoinbaseWalletSDK is not a constructor" from packages.
I've looked in package where it's happened and saw that dynamic import provide an unexpected wrapper with default property for it and package don't expect it.
When i build for production it works well, so i think it's something with esbuild.

For example webpack and rollup build this think without additional wrapper and package expect the same.

Here piece of code from module with dynamic import
return Promise.resolve(import('@coinbase/wallet-sdk').then(function (m) {
var _m$default;
return (_m$default = m == null ? void 0 : m["default"]) != null ? _m$default : m;
})).then(function (CoinbaseWalletSDK) {....}Reproduction
https://vitejs-vite-yyulnd--5173.local.webcontainer.io
Steps to reproduce
No response
System Info
System:
OS: macOS 12.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 450.68 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
Browsers:
Chrome: 106.0.5249.103
Safari: 15.5
npmPackages:
@vitejs/plugin-react: ^2.1.0 => 2.1.0
vite: 3 => 3.1.7Used 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 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.
Reactions are currently unavailable