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

jspm install twind fails #2566

Open
schlichtanders opened this issue Mar 22, 2024 · 1 comment
Open

jspm install twind fails #2566

schlichtanders opened this issue Mar 22, 2024 · 1 comment

Comments

@schlichtanders
Copy link

schlichtanders commented Mar 22, 2024

I first installed twind via npm (which works) and then tried to install it also to jspm with jspm install twind. But it fails

file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:1824
                throw new Error(`Invalid exports target ${target} resolving ./${subpath} in ${packageUrl}`);
                      ^

Error: Invalid exports target import resolving ./ in https://esm.sh/*style-vendorizer@2.2.3/
    at Resolver.resolvePackageTarget (file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:1824:23)
    at Resolver.resolvePackageTarget (file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:1838:43)
    at Resolver.resolveExport (file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:1705:71)
    at async TraceMap.resolve (file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:2935:59)
    at async TraceMap.visit (file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:2717:26)
    at async file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:2754:13
    at async Promise.all (index 0)
    at async TraceMap.visit (file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:2749:9)
    at async file:///home/myhome/.npm-packages/lib/node_modules/jspm/node_modules/@jspm/generator/dist/generator-a8fe28f4.js:2754:13
    at async Promise.all (index 0)

Node.js v20.11.1
@guybedford
Copy link
Member

Thanks for posting, this is an esm.sh provider-specific issue because the esm.sh provider treats subpaths of packages as their exports paths and not their file paths, and as a result JSPM must delegate to its resolution.

Fixed some bugs in jspm/generator#346, which should resolve this when released.

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

No branches or pull requests

2 participants