-
Notifications
You must be signed in to change notification settings - Fork 8
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
decimal128 does not play nicely with tsc #119
Comments
It looks like there's some dead code in the examples you give. I'm not sure why those are being regarded as errors, but I can remove the dead code and we can try again. I've also merged in some changes, in #121 , that might be relevant. |
Thanks for looking into this. My point was that it shouldn't even touch eg.
Judging by the title it sounds a good change. However, I updated
|
I took a small peek in Lines 57 to 59 in b218eaa
{
"exports": {
"types": "./dist/esm/Decimal128.d.mts",
"default": "./dist/esm/Decimal128.mjs"
}
} I took this inspiration from Changing this in I'm not fully sure how to export CJS though. Maybe: {
"exports": {
"types": "./dist/esm/Decimal128.d.mts",
"require": "./dist/cjs/Decimal128.cjs"
"default": "./dist/esm/Decimal128.mjs"
}
} EDIT: {
"exports": {
".": {
"types": {
"require": "./index.d.cts",
"default": "./index.d.ts"
},
"browser": {
"require": "./dist/browser/axios.cjs",
"default": "./index.js"
},
"default": {
"require": "./dist/node/axios.cjs",
"default": "./index.js"
}
}
} So, maybe this would work: {
"exports": {
"types": {
"require": "./dist/cjs/Decimal128.d.mts"
"default": "./dist/esm/Decimal128.d.mts"
},
"default": {
"require": "./dist/cjs/Decimal128.cjs"
"default": "./dist/esm/Decimal128.mjs"
}
}
} or just this? {
"exports": {
"types": {
"require": "./dist/cjs/Decimal128.d.mts"
"default": "./dist/esm/Decimal128.d.mts"
},
"require": "./dist/cjs/Decimal128.cjs"
"default": "./dist/esm/Decimal128.mjs"
}
} |
I am able to reproduce the issue too using 20.1.0 using Changing the I have raised another PR here -> #123 |
Summary
I tried to use this with Vite's
react-ts
template. While it works nicely innpm run dev
mode,npm run build
fails, because TypeScript tries to compile package's.mts
file for unknown reason.Steps to reproduce
Here's a repository where you can reproduce the issue:
git clone https://github.com/ljani/decimal128-tsc-issue cd decimal128-tsc-issue npm run ci npm run build
Expected result
The build completes fine.
Actual result
The build fails with:
Steps to reproduce (the long way)
→ same result
Notes
tsc -b
, which fails, notvite build
The text was updated successfully, but these errors were encountered: