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

Import module directly from unpkg #3083

Closed
candlerb opened this issue Sep 7, 2020 · 1 comment
Closed

Import module directly from unpkg #3083

candlerb opened this issue Sep 7, 2020 · 1 comment

Comments

@candlerb
Copy link

candlerb commented Sep 7, 2020

I believe it should be possible to import ES modules directly from unpkg - working examples.

However it doesn't appear to work with xterm.js.

Try 1:

<script type="module">
import { Terminal } from 'https://unpkg.com/xterm@latest?module';
alert("OK!");
</script>

This redirects to /xterm@4.8.1?module which returns 404 with message "Package xterm@4.8.1 does not contain an ES module"

Try 2:

<script type="module">
import { Terminal } from 'https://unpkg.com/xterm@latest/lib/xterm.js?module';
alert("OK!");
</script>

This URL serves some minified Javascript, but the import aborts with:

Uncaught SyntaxError: The requested module 'https://unpkg.com/xterm@latest/lib/xterm.js?module' does not provide an export named 'Terminal'

Have I missed something, or would something need changing in xterm.js to support this?

@Tyriar
Copy link
Member

Tyriar commented Sep 7, 2020

Duplicate of #2878

@Tyriar Tyriar marked this as a duplicate of #2878 Sep 7, 2020
@Tyriar Tyriar closed this as completed Sep 7, 2020
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