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

Uncaught SyntaxError: The requested module 'https://esm.sh/v86/keycode@2.2.1/es2022/keycode.js' does not provide an export named 'codes' #362

Closed
cristiano-belloni opened this issue Jul 7, 2022 · 1 comment

Comments

@cristiano-belloni
Copy link
Contributor

Hello,
I'm trying to run a third party application that imports { codes } as a name dependency from keycode:

import { codes } from 'keycode';

This works perfectly when bundled, but doesn't work with esm.sh:

import { codes } from 'https://esm.sh/keycode@2.2.1'

-> Uncaught SyntaxError: The requested module 'https://esm.sh/v86/keycode@2.2.1/es2022/keycode.js' does not provide an export named 'codes'

It seems that keycode.js is missing all the named exports that should be extracted from the source cjs module and only has the default, combined one. Might this be because keycode does things like var codes = exports.code = exports.codes = {...} and trips the esm translation algorithm?

@roziscoding
Copy link

roziscoding commented Jul 24, 2022

I have a similar the same error when importing vscode-oniguruma:

Uncaught SyntaxError: The requested module '/v87/vscode-oniguruma@1.6.2/deno/vscode-oniguruma.js' does not provide an export named 'loadWASM'

@ije ije closed this as completed in 6a5ed3e Jul 28, 2022
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

No branches or pull requests

2 participants