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

Can we use sucrase as esm in browser? #644

Open
varHarrie opened this issue Aug 11, 2021 · 1 comment
Open

Can we use sucrase as esm in browser? #644

varHarrie opened this issue Aug 11, 2021 · 1 comment

Comments

@varHarrie
Copy link

const script = document.createElement('script')

script.setAttribute('type', 'module')
script.setAttribute('src', 'https://unpkg.com/sucrase@3.20.1/dist/index.mjs')
// or
// script.innerText = 'import s from "https://unpkg.com/sucrase@3.20.1/dist/index.mjs"'

document.body.appendChild(script)

Run the above code and got error:

Uncaught SyntaxError: The requested module './CJSImportProcessor' does not provide an export named 'default'
@curran
Copy link

curran commented Dec 7, 2021

Related: #507

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