clojurescript

Shantanu Kumar 2025-12-02T08:55:07.414239Z

Hi, I am trying to use the npm jose library "jose": "^5.6.3": https://github.com/panva/jose/blob/main/src/index.ts in CLJS code. Can anyone tell me how to require the namespace correctly and use it? I am requiring ["jose" :as jose] and tried (.decodeJwt jose jwt) and (jose/decodeJwt jwt) but I get the error ExceptionInfo: could not find string alias for "jose" from myapp.core.

Arek 2025-12-02T09:50:25.097999Z

What is your build tool? Also make sure you it's actually in your node_modules

schadocalex 2025-12-02T10:00:35.705159Z

the library uses the export * as X syntax that is not supported by google closure compiler so neither is shadowcljs

schadocalex 2025-12-02T10:06:16.184839Z

You could use the :js-options {:js-provider :external} option in the shadowcljs config as a workaround, altough I don't exactly know all the implications for the others packages https://shadow-cljs.github.io/docs/UsersGuide.html#js-provider

schadocalex 2025-12-02T10:09:59.022369Z

ho actually there's an issue for this exact same library: https://github.com/thheller/shadow-cljs/issues/1190 referencing https://github.com/google/closure-compiler/issues/4177

Shantanu Kumar 2025-12-02T11:19:25.194999Z

@aciep Shadow-cljs and file exists under node_modules after I ran npm i.

Shantanu Kumar 2025-12-02T11:21:43.959119Z

@schad.alexis Thanks for digging into it.

Shantanu Kumar 2025-12-02T13:46:15.366159Z

I reported the issue to the Jose repo, and they have released a fix: https://github.com/panva/jose/discussions/832 - however, I am still running into the same could not find string alias... error.

Shantanu Kumar 2025-12-02T13:50:59.459769Z

The fix commit is here: https://github.com/panva/jose/commit/6303d98efba00c9a3f8f3e814c85ac6e6944b11c - I see that export * is gone, but import * has been added.

Shantanu Kumar 2025-12-02T14:07:44.673449Z

Pinging @thheller for any ^ input.

schadocalex 2025-12-02T14:41:03.778519Z

it should work now, are you sure you have upgraded the package?

schadocalex 2025-12-02T14:41:49.746309Z

The import ["jose" :as jose] is the right one

schadocalex 2025-12-02T14:43:14.868429Z

You can double check looking at node_modules/jose/dist/webapi/index.js to see if there's still export * as or not

Shantanu Kumar 2025-12-02T14:45:14.174309Z

I did upgrade the package version, and refetched node_modules afresh. But still the same error. I will probably try out an independent project with just this one dependency.

Shantanu Kumar 2025-12-03T06:58:04.865629Z

It was an issue with my setup - it's working for me.

👍 1
thheller 2025-12-03T07:27:38.677049Z

well done getting the issue fixed 🙂

🙌🏽 1