-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
esm version missing index.js #624
Comments
This change happened between v1.3.2 and v1.3.3. I'm guessing there was a breaking change in one of the dependencies? I don't see how any of the changes to purify source code or your package.json would have caused this. You can work around the issue by using full import paths for the module your using; e.g. instead of |
In v1.3.3 TypeScript was updated from 4.7.4 to 4.9.5. Looks like this issue is related: Zoltu/typescript-transformer-append-js-extension#21 The problem is that ESM support was contributed by @semmel and I have no idea what the ESM spec is and how to generate output for it. |
The issue has definitely something to do with the Zoltu plugin (which essentially adds the .js extension to module imports as required by the esm spec). It is probably now incompatible with the latest typescript. From the top of my head solutions are:
The first approach is probably the best one and not a very risky option either. |
I have been curious about what FP library to try out in my latest side projects. I like Purify’s goals (respect that TS is not Haskell) and liked the “intro” vibe and nice documentation. I did hit this ESM bug, but importing from I’m assuming the goal for this library is to double publish CJS and ESM? (Can someone confirm?) |
I took another look at the repo today and think this is the first question we should answer: Why does this have three outputs?
Per my understanding, @semmel - Could you help clarify my understanding here? How do the |
I think we should drop the |
I agree. It seems that we only want one of these two. I think the name So, I think the tentative recommendation is
|
I'll get to it this weekend, in the meantime any help/PRs are welcome. |
@connorjs @atomictag @matt-mcmahon Can any of you confirm that the new 2.0.0 version is working fine? |
v2.0.0 looks good 👍 The index.js file is where TS/Node will expect it. Current version of my project builds with Vite and Purify v2.0.0 successfully, no errors in my use case due to removal of the ES folder. My project isn't currently broken under 1.3.5, so I checked out an earlier release that I knew broke after upgrading from 1.3.2 to 1.3.3.
So TS/Node seems to be finding the index.js file where it expects it. I mean, it should because the file's exists again, but there's enough complications with how ESM imports work that I wanted to double check. 😅 |
v2.0.0 looks good to me too. I updated and was able to change the |
Amazing news! |
I have just updated to 1.3.5 from 1.3.2 and started getting some weird errors in webpack. I think the root cause is the missing index.js/index.d.ts in the "esm" folder of the latest distribution (took me a while to figure this out - tooling error messages are cryptic to say the least). Oddly enough it was working fine in other setups - guess the "es" version was picked instead
The text was updated successfully, but these errors were encountered: