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
TypeScript declaration is wrong in CommonJS #136
Comments
You can fix by telling rollup to force default export but this will make people need require("x").default but if you don't do this it will happen as soon as someone adds a named export |
I think if we want interop it is best to avoid module.exports assignment altogether |
@krisselden I agree. Personally, I don't mind having to do |
this is likely a breaking change for Node.js/JS users. closes tildeio#136
Is there a change this being merged in for a new version? |
I was really hoping to use this lib in one of my project, because I was sure I could share code between frontend and backend, but I guess I was wrong :( |
this is likely a breaking change for Node.js/JS users. closes tildeio#136
FWIW this is now solved by typescript with the |
The
.d.ts
file exports a default class, which makes TypeScript look for a.default
property on theexports
object in CommonJS. However, in CommonJS environments, theexports
object is set to the class itself. This makes it unusable in Node.js/TypeScript projects.The text was updated successfully, but these errors were encountered: