solid-client-authn-js icon indicating copy to clipboard operation
solid-client-authn-js copied to clipboard

deno-runtime - `User` not exported from `@inrupt/oidc-client-ext`

Open elycruz opened this issue 1 year ago • 0 comments

Search terms you've used

deno

Impacted package

Which packages do you think might be impacted by the bug ?

  • [x] solid-client-authn-browser
  • [ ] solid-client-authn-node
  • [ ] solid-client-authn-core
  • [x] oidc-client-ext
  • [ ] Other (please specify): ...

Bug description

When attempting to write a script containing imports from @inrupt/solid-client-authn-browser, for the deno runtime, I'm getting errors about a User type not being exported from @inrupt/oidc-client-ext:

figure 1 (example-script.ts)

import {
  login,
  handleIncomingRedirect,
  getDefaultSession,
  fetch
} from "@inrupt/solid-client-authn-browser";

function loginToSelectedIdP(selectedIdP: string) {
  return login({
    oidcIssuer: selectedIdP,
    redirectUrl: new URL("/", window.location.href).toString(),
    clientName: "Getting started app"
  });
}

figure 2

$ deno run example-script.ts
error: Uncaught SyntaxError: The requested module '/v135/@inrupt/[email protected]/denonext/oidc-client.mjs' does not provide an export named 'User'
    at <anonymous> (https://esm.sh/v135/@inrupt/[email protected]/denonext/oidc-client-ext.mjs:2:245)

The error also happens when importing the code snippet in a fresh app:

figure 3

$ deno task start
Task start deno run -A --watch=static/,routes/ dev.ts
Watcher Process started.
The manifest has been generated for 5 routes and 2 islands.
error: Uncaught (in promise) SyntaxError: The requested module '/v135/@inrupt/[email protected]/denonext/oidc-client.mjs' does not provide an export named 'User' at https://esm.sh/v135/@inrupt/[email protected]/denonext/oidc-client-ext.mjs:2:245
  const manifest = (await import(toFileUrl(join(dir, "fresh.gen.ts")).href))
                    ^
    at async dev (https://deno.land/x/[email protected]/src/dev/dev_command.ts:38:21)
    at async file:///.../solid-fresh-example/dev.ts:8:1
Watcher Process failed. Restarting on file change...

To Reproduce

  1. Clone the example-app here, and/or: i. generate a fresh 'fresh' app ii. Copy the '@inrupt/...' imports (from the example-app (above)) , to './deno.json'. iii. Copy the script in figure 1 to the code-base.
  2. Run the script from the terminal (e.g. $ deno run example-script.ts) (comment out call to login, in SolidProtocolExample.tsx (if running script from cloned app (mentioned above)).
  3. See resulting error.
  4. Alternately run the fresh app: $ deno task start.
  5. See the resulting error.

Expected result

No build/parse-time [deno] errors should occur.

Actual result

Following error occurs:

When running standalone script

$ deno run example-script.ts
error: Uncaught SyntaxError: The requested module '/v135/@inrupt/[email protected]/denonext/oidc-client.mjs' does not provide an export named 'User'
    at <anonymous> (https://esm.sh/v135/@inrupt/[email protected]/denonext/oidc-client-ext.mjs:2:245)

When running fresh app:

$ deno task start
Task start deno run -A --watch=static/,routes/ dev.ts
Watcher Process started.
The manifest has been generated for 5 routes and 2 islands.
error: Uncaught (in promise) SyntaxError: The requested module '/v135/@inrupt/[email protected]/denonext/oidc-client.mjs' does not provide an export named 'User' at https://esm.sh/v135/@inrupt/[email protected]/denonext/oidc-client-ext.mjs:2:245
  const manifest = (await import(toFileUrl(join(dir, "fresh.gen.ts")).href))
                    ^
    at async dev (https://deno.land/x/[email protected]/src/dev/dev_command.ts:38:21)
    at async file:///.../solid-fresh-example/dev.ts:8:1
Watcher Process failed. Restarting on file change...

Environment

On WSL2:

  System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 11.89 GB / 15.57 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.19.0/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
    pnpm: 8.13.1 - ~/.nvm/versions/node/v18.19.0/bin/pnpm
  Browsers:
    Chrome: 122.0.6261.94
  npmGlobalPackages:
    corepack: 0.22.0
    npm: 10.2.3

Deno ($ deno --version):

  deno 1.39.2 (release, x86_64-unknown-linux-gnu)
  v8 12.0.267.8
  typescript 5.3.3

Also seeing the same error with:

deno 1.41.0 (release, x86_64-unknown-linux-gnu)
v8 12.1.285.27
typescript 5.3.3

Additional information

None.

elycruz avatar Feb 29 '24 20:02 elycruz