Created
September 27, 2021 16:29
Revisions
-
also renamed this gist
Sep 27, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
also created this gist
Sep 27, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ If the imports in `entry.mjs` are sorted, running `node entry.mjs` will fail with ``` node entry.mjs file:///Users/rberdeen/work/scratch/test-import-circular-order/b.mjs:5 export default { name, other: other.name }; ^ ReferenceError: name is not defined at file:///Users/rberdeen/work/scratch/test-import-circular-order/b.mjs:5:37 at ModuleJob.run (internal/modules/esm/module_job.js:152:23) at async Loader.import (internal/modules/esm/loader.js:177:24) at async Object.loadESM (internal/process/esm_loader.js:68:5) ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ import * as other from './b.mjs'; export const name = 'a'; export default () => ({ name, other: other.name }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ import * as other from './a.mjs'; export const name = 'b'; export default { name, other: other.name }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ // the order of these imports is important import b from './b.mjs'; import a from './a.mjs'; console.log({ a: a(), b });