1 decade ago by appMobiTony
This probably applies to other versions of Impact, but I am using 1.18a.
If you start Impact up in such a way that (document.readyState === 'complete') is true, you will fall into an error detection case and get the 'Unresolved (circular?) dependencies. ' error. This is because module() calls ig._initDOMReady(), which goes ahead with _execModules (because document.readyState is 'complete') and attempts to process the impact module. However, requires() and defines() have not yet run for the impact module, so you get into the error case as previously mentioned.
I fixed this issue by making the following changes in lib/impact/impact.js:
1. In module(), do no call ig._initDOMReady()
2. In defines(), replace the call to ig._execModules() with a call to ig._initDOMReady().
This allows the impact module's requires and defines to run before getting into _execModules() via _initDOMReady().
There aren't any undesired side effects that I noticed, but if there is something I am not aware of, please let me know.
If you start Impact up in such a way that (document.readyState === 'complete') is true, you will fall into an error detection case and get the 'Unresolved (circular?) dependencies. ' error. This is because module() calls ig._initDOMReady(), which goes ahead with _execModules (because document.readyState is 'complete') and attempts to process the impact module. However, requires() and defines() have not yet run for the impact module, so you get into the error case as previously mentioned.
I fixed this issue by making the following changes in lib/impact/impact.js:
1. In module(), do no call ig._initDOMReady()
2. In defines(), replace the call to ig._execModules() with a call to ig._initDOMReady().
This allows the impact module's requires and defines to run before getting into _execModules() via _initDOMReady().
There aren't any undesired side effects that I noticed, but if there is something I am not aware of, please let me know.