Open jp06 opened 6 days ago
The commonjs resolver shouldn't be looking for "./dist/es"
. If you can provide a minimal repo to reproduce this error it would be of much help.
I'll try later today, but a quick info is that my code is a private fork of this repo: https://github.com/bigcommerce/b2b-buyer-portal
I think subpath exports are not supported by "moduleResolution": "node"
: https://stackoverflow.com/a/74538429 or it's very difficult to get it right. And the tsconfig document says You probably won’t need to use node10 in modern code.. Try changing it to bundler
.
Additional links:
Thanks, appreciate the help. I noticed that the moduleResolution
is actually not even under the compilerOptions
. Other import issues crop up though even if moduleResolution
fixes thebarcode-detector/pure
import , probably due to how it is set up, so I don't think I'll change it. In my case, the barcode-detector
import already fine so I'll just use that.
Not really a big blocker but just want to let you know that when I was gonna write a custom polyfilling logic with the pure import but I got this error on build with Vite:
I am able to import
barcode-detector
just fine.I have this
vite.json
extended by thetsconfig.json
: