ES6 modules: imported constants are undefined at first; they become available later
As suggested in the comments, the answer here are circular dependencies. There is actually no circular dependency present in the code provided in the question (because it’s just a simplified snippet of code) but the symptoms are very clear. The simplest example of a circular dependency is when file A imports file B and file … Read more