lume: import of particular client side javascript dependency fails

Version

1.16.0

Platform

deno 1.30.3 (release, x86_64-unknown-linux-gnu) v8 10.9.194.5 typescript 4.9.4

What steps will reproduce the bug?

When importing a package from “deno:https://esm.sh/react-table@7.8.0

with the following code:

import { useExpanded, useTable } from ‘npm:react-table’;

I get the following error:

✘ [ERROR] No matching export in “deno:https://esm.sh/react-table@7.8.0” for import “useExpanded”

deno:file:///home/maxou/dev/site-altorf/altorf/python-lib/openprot_pipeline/site/app/SearchScreen.jsx:3:9:
  3 │ import { useExpanded, useTable } from 'npm:react-table@7.8.0';
    ╵          ~~~~~~~~~~~

The exports are defined, as shown here (in the same version, i.e. 7.8.0): https://react-table-v7.tanstack.com/docs/examples/sub-components-lazy

This is probably an issue with the library not being packaged to Deno’s (or esbuild’s) taste, but I was wondering if there are other means to declare dependencies, where more “dependency incantation tweaking” is possible, I’m guessing import_map.json would probably be the place to do that, but I’m wondering if this map file only concerns imports for Lume’s static/build time rendering, or if I can do some dependency tweaking for esbuild in there.

How often does it reproduce? Is there a required condition?

reproduces with:

git clone https://github.com/max-l/react-todo/blob/main/app/app.tsx
cd react-todo
deno task lume --serve 

What is the expected behavior?

proper import of module

What do you see instead?

error message in stdout

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Great, I think this issue can be closed, as it’s a esm.sh problem that has the “?cjs-exports” workaround.

Thanks !