Skip to content

Instantly share code, notes, and snippets.

@mdarse
Last active May 20, 2020 18:24
Show Gist options
  • Save mdarse/c27f5d52455938241cfc7ab7c0cec946 to your computer and use it in GitHub Desktop.
Save mdarse/c27f5d52455938241cfc7ab7c0cec946 to your computer and use it in GitHub Desktop.
Broken module binding with top level await & dynamic import
import B from "./b.js";
console.log(B); // "undefined" or "X" depending on export in b.js
let x;
// export default x; // broken
export { x as default }; // ok
x = await import("./c.js").then((mod) => mod.default);
export default 'X';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment