Repository navigation
codemirror v6 couldn't be installed with snowpack 2.18.3 #1954
Unanswered
twop
asked this question in
Troubleshooting
Replies: 1 comment 2 replies
|
You're right, it's failing here: We're kind of stuck here, tbh. We have two ways to fetch a package.json manifest for a package by name:
I actually don't think there's any possible way to do this without either @twop for now, the package will either need to add a 'package.json' or a '.' entrypoint to thier export map for it to work in Snowpack. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
codemirror@next is shipped as esmodule package with import map
https://github.com/codemirror/codemirror.next/blob/master/package.json
Note that there is no package.json in the
exportsmapRelevant snippet:
{ "name": "@codemirror/next", "version": "0.15.0", "type": "module", "exports": { "./state": "./state/dist/index.js", "./text": "./text/dist/index.js", "./view": "./view/dist/index.js", "./commands": "./commands/dist/index.js", "./history": "./history/dist/index.js", "./collab": "./collab/dist/index.js", "./gutter": "./gutter/dist/index.js", "./rangeset": "./rangeset/dist/index.js", "./language": "./language/dist/index.js", "./language-desc": "./language-desc/dist/index.js", "./fold": "./fold/dist/index.js", "./matchbrackets": "./matchbrackets/dist/index.js", "./closebrackets": "./closebrackets/dist/index.js", "./panel": "./panel/dist/index.js", "./tooltip": "./tooltip/dist/index.js", "./search": "./search/dist/index.js", "./goto-line": "./goto-line/dist/index.js", "./lint": "./lint/dist/index.js", "./highlight": "./highlight/dist/index.js", "./stream-parser": "./stream-parser/dist/index.js", "./autocomplete": "./autocomplete/dist/index.js", "./comment": "./comment/dist/index.js", "./rectangular-selection": "./rectangular-selection/dist/index.js", "./highlight-selection": "./highlight-selection/dist/index.js", "./basic-setup": "./basic-setup/dist/index.js", "./lang-javascript": "./lang-javascript/dist/index.js", "./lang-java": "./lang-java/dist/index.js", "./lang-json": "./lang-json/dist/index.js", "./lang-cpp": "./lang-cpp/dist/index.js", "./lang-python": "./lang-python/dist/index.js", "./lang-css": "./lang-css/dist/index.js", "./lang-html": "./lang-html/dist/index.js", "./lang-sql": "./lang-sql/dist/index.js", "./lang-rust": "./lang-rust/dist/index.js", "./lang-xml": "./lang-xml/dist/index.js", "./lang-markdown": "./lang-markdown/dist/index.js", "./theme-one-dark": "./theme-one-dark/dist/index.js" }, }After I upgraded to version 2.18.3 I started to get this error:
Which is true :)
I'm not sure why it is required though, I read node docs https://nodejs.org/api/packages.html#packages_exports and skypack https://docs.skypack.dev/package-authors/package-checks#export-map and I can't find a mention about package.json.
Thus it seems that the logic here https://github.com/snowpackjs/snowpack/blob/5e22dae6825d24a375b56bf2dd7141c5f19b9a1b/skypack/src/util.ts#L88 is incomplete.
I want to upgrade to 2.18.3 because it seems to support webworkers in dev mode but I can't because of this issue.
NOTE: version 2.17.1 seems to have no issues with that
All reactions