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

Error "Trailing "/" installs not supported installing" when installing react-intl using esm.sh provider #2541

Closed
MilanKovacic opened this issue Aug 12, 2023 · 2 comments · Fixed by jspm/generator#316

Comments

@MilanKovacic
Copy link

Reproduction steps:

  1. Run jspm install react-intl --provider esm.sh
  2. The following importmap.json is generated:
{
  "env": [
    "browser",
    "development",
    "module"
  ],
  "imports": {
    "react-intl": "https://esm.sh/*react-intl@6.4.4/lib/index.js"
  },
  "scopes": {
    "https://esm.sh/": {
      "@formatjs/ecma402-abstract": "https://esm.sh/*@formatjs/ecma402-abstract@1.17.0/lib/index.js",
      "@formatjs/fast-memoize": "https://esm.sh/*@formatjs/fast-memoize@2.2.0/lib/index.js",
      "@formatjs/icu-messageformat-parser": "https://esm.sh/*@formatjs/icu-messageformat-parser@2.6.0/lib/index.js",
      "@formatjs/icu-skeleton-parser": "https://esm.sh/*@formatjs/icu-skeleton-parser@1.6.0/lib/index.js",
      "@formatjs/intl": "https://esm.sh/*@formatjs/intl@2.9.0/lib/index.js",
      "@formatjs/intl-localematcher": "https://esm.sh/*@formatjs/intl-localematcher@0.4.0/lib/index.js",
      "hoist-non-react-statics": "https://esm.sh/*hoist-non-react-statics@3.3.2/dist/hoist-non-react-statics.cjs.js/index.js",
      "intl-messageformat": "https://esm.sh/*intl-messageformat@10.5.0/lib/index.js",
      "react": "https://esm.sh/*react@18.2.0",
      "react-is": "https://esm.sh/*react-is@16.13.1/index.js",
      "tslib": "https://esm.sh/*tslib@2.6.1"
    }
  }
}
  1. Re-run jspm install react-intl --provider esm.sh
  2. The following error is generated:
    Error: Trailing "/" installs not supported installing https://esm.sh/*tslib@2.6.1/ for https://esm.sh/v130/react-intl@6.4.4/X-ZS8q/esnext/lib.js
@guybedford
Copy link
Member

Thanks for posting, The problem here is that JSPM is seeing the "tslib": "https://esm.sh/*tslib@2.6.1" mapping for tslib as mapping into the package boundary, since it isn't a full resolved module path to a .js file. JSPM always tracks the package boundary point to manage exports fields mappings, so in this case it's seeing the mapping as being the package boundary itself using that locked mapping during regeneration, and then not supporting it.

The original concept behind trailing "/" installs was being able to do something like jspm install pkg/ and install all exports of the package at once something like a wildcard. But in this position that error certainly makes no sense at all.

Will work on a fix in the generator now.

@guybedford
Copy link
Member

jspm/generator#316 should fix this - as soon as that's passing CI we'll roll out a release cycle this week.

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

Successfully merging a pull request may close this issue.

2 participants