Cannot use import from outside a module #11548
Labels
i: bug
i: needs triage
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
Bug Report
Current Behavior
Babel is not able to resolve the
import
statement as the native Browser.Code setup:
Working example without Babel:
Example with Babel which is not working:
Babel throws the following error:
If i don't set the data-presets attribute, I get an error that require is not defined.
Am i missing something or is this a Bug ?
Why do i wanna get this going?
If this will work you could set data-presets to "typescript" and call your typescript files "*.ts.js". Then you would be able to prototype Typescript and also split your code into different files without having to setup a bundler or ANYTHING.
To me, this is the sexiest and minimalist setup i could imagine.
The text was updated successfully, but these errors were encountered: