You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No idea what's your meaning, when using type: module + tsconfig with module: node16:
commonjs.default is required by TypeScript, but it's wrong. commonjs.default is undefined.
error TS2349: This expression is not callable. Type 'typeof import("/Users/JounQin/Workspaces/GitHub/pkgr/node_modules/@rollup/plugin-commonjs/types/index")' has no call signatures.107 const cjs = (sourceMap: boolean) => commonjs({ sourceMap })
@shellscape Nope, .d.ts and .d.mts should be splitted for require and import, it's a common mistake
for TypeScript packages, I can raise a PR for them.
Reacted by Lennon Wang, Peter Jaško and Steven Vachon
@just-boris please show restraint in adding noise. your reply doesn't contribute anything useful. Follow the repo's activity if you wan to know what's going on in the repo. Further noise will result in the issue being locked.
@shellscape I was about to open a PR to fix the initial problem of this issue.
Instead of opening a PR for that problem, maybe I can help with what you actually said.
Do you need help with this? Maybe we can migrate all together to tsdown for build, and later decide if we want to drop the CJS build?
When we ship only esm the types will be only esm and this will self-resolve
I'm encountering problems with these packages. I can help with them
Activity
shellscape commentedon Apr 6, 2025
We have a big project ahead with going ESM for all plugins - Node 18 is now out of LTS and 20 and 22 support clean ESM require in commonjs.
JounQin commentedon Apr 6, 2025
@shellscape It's about types, not runtime codes.
shellscape commentedon Apr 6, 2025
think about it carefully:)
JounQin commentedon Apr 6, 2025
No idea what's your meaning, when using
type: module+tsconfigwithmodule: node16:commonjs.defaultis required by TypeScript, but it's wrong.commonjs.defaultis undefined.I have to use the following for workaround
https://github.com/un-ts/pkgr/blob/a4acfbcab1a22236605f56c7b4355a63bc656877/packages/rollup/src/config.ts#L108
shellscape commentedon Apr 6, 2025
When we ship only esm the types will be only esm and this will self-resolve. Last I'll be commenting on this issue until the esm migration starts.
JounQin commentedon Apr 6, 2025
@shellscape Nope,
.d.tsand.d.mtsshould be splitted forrequireandimport, it's a common mistakefor TypeScript packages, I can raise a PR for them.
shellscape commentedon Apr 6, 2025
We're going to use tshy. Please chill.
JounQin commentedon Apr 6, 2025
@shellscape Then why you're saying:
It doesn't required to be ESM only.
just-boris commentedon Oct 31, 2025
Are there any news on this thread? The issue still exists today and it does not allow to use Typescript for Rollup configs
shellscape commentedon Oct 31, 2025
@just-boris please show restraint in adding noise. your reply doesn't contribute anything useful. Follow the repo's activity if you wan to know what's going on in the repo. Further noise will result in the issue being locked.
unrevised6419 commentedon Sep 16, 2026
@shellscape I was about to open a PR to fix the initial problem of this issue.
Instead of opening a PR for that problem, maybe I can help with what you actually said.
Do you need help with this? Maybe we can migrate all together to
tsdownfor build, and later decide if we want to drop the CJS build?I'm encountering problems with these packages. I can help with them
@rollup/plugin-swc@rollup/plugin-json@rollup/plugin-node-resolve@rollup/plugin-dynamic-import-vars@rollup/plugin-commonjs@rollup/plugin-imageRelated: #1894