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

es-cookie is breaking CJS versions #964

Closed
benjervis opened this issue Aug 25, 2022 · 5 comments · Fixed by #965
Closed

es-cookie is breaking CJS versions #964

benjervis opened this issue Aug 25, 2022 · 5 comments · Fixed by #965
Labels
bug report This issue reports a suspect bug or issue with the SDK itself

Comments

@benjervis
Copy link

benjervis commented Aug 25, 2022

Describe the problem

auth0-spa-js depends on es-cookie, which has recently gone ESM only, and done it as a minor version. This is breaking CJS projects using auth0-spa-js.

In our case, this is a Jest test that's failing on unknown token export.

Auth0 should look to move off this library to maintain CJS support.

Reproduction

https://github.com/benjervis/auth0-escookie-issue

Environment

  • Version of auth0-spa-js used: 1.22.2
  • Which browsers have you tested in? N/A
  • Which framework are you using, if applicable (Angular, React, etc): N/A
  • Other modules/plugins/libraries that might be involved: es-cookie, I guess Jest also
@benjervis benjervis added the bug report This issue reports a suspect bug or issue with the SDK itself label Aug 25, 2022
@theodorejb
Copy link

theodorejb commented Aug 25, 2022

Author of es-cookie here. I suppose auth0-spa-js could also pin "1.3.2" specifically (instead of "^1.3.2") in package.json to retain CommonJS support.

I'm surprised there are still many CJS-only projects, though. It seems like that would be increasingly limiting as more and more libraries are designed for ESM from the start.

@weyert
Copy link

weyert commented Aug 25, 2022

One of the reasons is that I am not smart enough to get ESM packages working with Jest + Typescript ☹️ Personally, I think making an package ESM is breaking change as the public API changed

@mrm007
Copy link

mrm007 commented Aug 25, 2022

I'm surprised there are still many CJS-only projects, though.

96% of the packages in the npm registry, to be more precise. ESM including dual CJS/ESM is today at 4%.
Source: https://twitter.com/wooorm/status/1555258256582385664

@frederikprijck
Copy link
Member

Thanks for raising this. I have pinned es-cookie to the latest patch versions only.

@frederikprijck
Copy link
Member

Should be fixed as part of 1.22.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report This issue reports a suspect bug or issue with the SDK itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants