Open NiloCK opened 1 year ago
Response from the related issue filed vitejs/vite: https://github.com/vitejs/vite/issues/13031#issuecomment-1527404705
Quoting in full:
The bundled file is from
dist/node/...
, where it should be fromdist/web/...
.
js-big-decimal
doesn't declareexports
/browser
field and therefore Vite resolves the package withmain
field that points todist/node/...
.You can specify the actual file instead.
import "js-big-decimal/dist/web/js-big-decimal.js"
Although, It doesn't work because
js-big-decimal
doesn't support ESM.Closing as it's working as intended.
@NiloCK Please validate and close this.
Describe the bug vite projects fail to consume js-big-decimal.
To Reproduce Repro repo is here: https://github.com/NiloCK/vite-bigdecimal-import-reproduction
See the readme.
Expected behavior In the repo,
yarn dev
should serve the sample app page, with the counter integer replaced by a bigDecimal.Additional context The vite site seems to be mistakenly importing content from the
dist/node
folder, instead ofdist/web
There is some issue with: