In the simple example below im getting the following error :
ReferenceError: Cannot access 'shared' before initialization
but if i change the export default 2 to a function it will work. Why is this behaviour?
index.js
import a from "./testA.js";
export default 2;
testA.js
import shared from "./index.js";
console.log(shared);
export default function () {}