Skip to content
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

Types broken in latest release #111

Closed
thewilkybarkid opened this issue Dec 20, 2021 · 7 comments
Closed

Types broken in latest release #111

thewilkybarkid opened this issue Dec 20, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@thewilkybarkid
Copy link

It looks like it's been fixed, but the types available in the latest release (2.1.0) are broken (TypeScript complains with a '... is not a module' error).

Is it possible to release a new patch version with the fix?

@Bikossor
Copy link
Owner

I'm looking into it

@Bikossor
Copy link
Owner

@thewilkybarkid can you provide an example where TypeScript complains?

@Bikossor Bikossor self-assigned this Dec 20, 2021
@thewilkybarkid
Copy link
Author

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAQwHYSQTxAVwM5wGZQQhwBEyqGOJA3AFC3npbYB0AxlAKYIycAUASlpA

anonymus.d.ts looks like:

declare var anonymus: {
    // [...]
    create: (amount: any) => any[];
};

Looking at

anonymus/src/anonymus.ts

Lines 273 to 275 in 9a6c0c9

if (typeof module !== "undefined" && module.exports) {
module.exports = anonymus;
}
there's a conditional export so the TypeScript compiler doesn't generate a valid module definition (i.e. there's no export = anonymus).

I see that there have been commits to change the library to use ESM, and develop does currently generate a valid definition file.

@Bikossor
Copy link
Owner

Yeah I think the problem is that develop has not been released since then 😅

@Bikossor Bikossor added the bug Something isn't working label Dec 20, 2021
@Bikossor
Copy link
Owner

Bikossor commented Dec 20, 2021

I released a new version 2.1.1 (npm)

Let me know if this works for you 😄

@thewilkybarkid
Copy link
Author

Thanks! The types look right, but main in package.json refers to anonymus.min.js but it just seems to be called anonymus.js...

@Bikossor
Copy link
Owner

I've noticed that mismatch too. There are other things too that aren't quite right yet. This was caused by the structural changes I did lately. I'll try to fix it all up asap. Thank you very much for reporting these issues 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants