martok / palefill

Inject Polyfills for various web technologies into pages requiring them
https://martok.github.io/palefill/
Mozilla Public License 2.0
79 stars 9 forks source link

SyntaxError: expected expression, got keyword 'import' #43

Closed InterLinked1 closed 2 years ago

InterLinked1 commented 2 years ago

Thanks for all the work everyone has done on this so far.

Would it be possible to polyfill (or transpile, if necessary), the "import" keyword?

Unfortunately, some sites seem to be using that in the browser now.

It's constant whack-a-mole these days with browser breakage and cleaning up everyone's mess.

SyntaxError: expected expression, got keyword 'import'
martok commented 2 years ago

Duplicate of #34.

I've just re-tested with a minimal example, the keyword form works as expected. index.html ```html modules ``` show.js ```js export function showMessage() { alert("hello world"); } ``` showImport.js ```js import {showMessage} from "./show.js" window.showImportedMessage = function showImportedMessage() { showMessage(); } ```