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

Not able to parse jose package for target :browser #1190

Closed
karannakraTR opened this issue Jul 8, 2024 · 4 comments
Closed

Not able to parse jose package for target :browser #1190

karannakraTR opened this issue Jul 8, 2024 · 4 comments

Comments

@karannakraTR
Copy link

karannakraTR commented Jul 8, 2024

System Details :
image

Shadow-cljs version: 2.20.20
jose version: 5.2.4

Error Details: I am trying to use jose package inside my shadow-cljs application but the development build is throwing this error

image

shadow-cljs.edn

image

Additional information

image

That's how jose exports the modules for browser and I think export * as from "" is the root cause of the error

@thheller
Copy link
Owner

thheller commented Jul 8, 2024

I suspect the Closure Compiler just doesn't support the export * as X syntax. To be honest I didn't even know that existed. Seems like its maybe not that common? Not something I can do something about unfortunately. I tried searching the https://github.com/google/closure-compiler issues but couldn't find anything related.

:js-provider :require works because it means shadow-cljs is not processing any npm code. Of course also means something else must, which is not that easy for :browser. You can try :external and setup webpack or so.

@karannakraTR
Copy link
Author

I think this is such a common syntax, It can raise issues in future for sure. Also is there any doc which I can refer to but the easiest approach I think is to switch it with something else.

@thheller
Copy link
Owner

thheller commented Jul 8, 2024

Not much I can do. Its not export * from ... is common and supported, export * as X from ... I have never seen before, so not that common.

I reported it upstream to the Closure Compiler Team as it easily reproduces without shadow-cljs involved. Closing this as I can't do much on my end. Feel free to follow the linked issue.

@thheller thheller closed this as completed Jul 8, 2024
@karannakraTR
Copy link
Author

Thanks for the prompt response, It was really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants