Swifter
Swifter2y ago

Import is "Not yet initialized?"

No idea what this means. First screenshot is error, second screenshot is problematic line, third screenshot is the thing being imported. I don't know why it's saying it "hasn't been initialized", never run into this problem before and not sure what it's even supposed to mean.
5 Replies
Andreu Botella (they/them)
do you have an import cycle? where an imported module imports (modules that import...) the current module?
Swifter
SwifterOP2y ago
oh crap yeah animation.ts imports general.ts which imports environment.ts which imports internals/environment.ts which imports animation.ts fuck
Andreu Botella (they/them)
yeah, so import cycles make it so imported variables (when you're evaluating a module) are somehow "available" but they can't be used until the module they're from is evaluated and the order of module evaluation depends on the order of imports in every module not sure if that gives you any way to solve things other than refactor stuff to not have a cycle
Swifter
SwifterOP2y ago
might just have to refactor, but we'll see thanks!

Did you find this page helpful?