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

Installing lit from esm.sh provider is failing #335

Open
JayaKrishnaNamburu opened this issue Dec 9, 2023 · 1 comment
Open

Installing lit from esm.sh provider is failing #335

JayaKrishnaNamburu opened this issue Dec 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JayaKrishnaNamburu
Copy link
Member

Installation of lit package is failing right now when using esm.sh as a provider.

Expected

Installs the package and updates the import-map

Result

Fails with a error in resolving a import.

file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:1697
            throw new JspmError(`No '${subpath}' exports subpath defined in ${pkgUrl} resolving ${originalSpecifier}${importedFrom(parentUrl)}.`, "MODULE_NOT_FOUND");
                  ^

JspmError: No './css-tag' exports subpath defined in https://esm.sh/*@lit/reactive-element@2.0.2/ resolving @lit/reactive-element/css-tag imported from https://esm.sh/v135/@lit/reactive-element@2.0.2/X-ZS8q/esnext/reactive-element.mjs.
    at throwExportNotDefined (file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:1697:19)
    at Resolver.resolveExport (file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:1726:17)
    at async TraceMap.resolve (file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:2915:59)
    at async TraceMap.visit (file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:2719:26)
    at async file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:2756:13
    at async Promise.all (index 0)
    at async TraceMap.visit (file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:2751:9)
    at async file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:2756:13
    at async Promise.all (index 0)
    at async TraceMap.visit (file:///workspaces/sandbox/node_modules/@jspm/generator/dist/generator-387fd949.js:2751:9) {
  jspmError: true,
  code: 'MODULE_NOT_FOUND'
}

The resolution of the path /css-tag seems to failing. Could it be because the pacakge is exposing the modules with the file extension.
https://unpkg.com/browse/@lit/reactive-element@2.0.2/package.json

"./css-tag.js": {
      "types": "./development/css-tag.d.ts",
      "node": {
        "development": "./node/development/css-tag.js",
        "default": "./node/css-tag.js"
      },
      "development": "./development/css-tag.js",
      "default": "./css-tag.js"
    },

Here is a reproduction for the bug
https://codesandbox.io/p/devbox/list-esm-install-bug-y72sjm?file=%2Findex.js%3A4%2C18

@guybedford
Copy link
Member

I've disabled the esm.sh provider test for now. I think this is an esm.sh issue actually //cc @ije

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants