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
{{ message }}
Repository navigation
Types are not compatible with moduleResolution: "NodeNext" #2031
TypeScript resolves the CommonJS module as an object instead of a function, so calling the
plugin fails and the build breaks. The function can be reached with a manual .default
access, but that's not a safe workaround: depending on how the module is loaded, .default
is undefined at runtime (see FalseExportDefault).
The reason is a mismatch between the types and the runtime:
the package is CommonJS: "main": "dist/index.js", no exports field, no "type": "module";
dist/index.js exports the plugin with module.exports = rollupPluginLicense;;
For a CommonJS module, export default in the .d.ts describes module.exports.default,
which doesn't exist at runtime. arethetypeswrong
confirms this - it reports "Incorrect default export" for all resolution kinds
(node10, node16 from CJS, node16 from ESM, bundler).
One caveat: export = can't be combined with other export statements, so the exported
types (Options, Person, Dependency, ThirdParty, etc.) would need to be moved into
a declare namespace rollupPluginLicense block.
Activity