These are chat archives for systemjs/systemjs

10th
Jul 2018
Neil Stevens
@StickNitro
Jul 10 2018 12:15

Is it possible to identify the dependencies of a given module, for example say I have the module file http://localhost:4200/assets/modules/test-liba/test-liba.umd.js. If i call SystemJS.import(moduleLocation) then I get a bunch of exceptions that dependencies cannot be found (such as @angular/core and so on)

So is there a way to identify what modules the module I am loading depends on so I can set them using SystemJS.set()

Miloš Lapiš
@mlc-mlapis
Jul 10 2018 13:33
@StickNitro ... first SystemJS has to know where and how to find that dependencies if some module requires them. If it knows it via its config then they are automatically loaded. So just to know them is not enough.
Neil Stevens
@StickNitro
Jul 10 2018 14:18
Yeah I guessed that would be the answer but had to ask, I have had to park this part of the application for the moment and will need to revisit. It will haunt me i know because if a library adds a dependency that the core has not added using SystemJS.set(…) then everything will break, but for the time being im going to have to live with it until I can find the time to come back to it
Miloš Lapiš
@mlc-mlapis
Jul 10 2018 15:02
@StickNitro ... if the lib tries to call something outside and SystemJS config doesn't have that mapping then it breaks of course. But if you add it to the config it should work without any other modification.
uelton-hbsis
@uelton-hbsis
Jul 10 2018 16:09
@mlc-mlapis how to know what I need do map and how to map correctly?
I have updated several modules in a project and I get the error: "unexpected token <", but
but I do not always know which module to map, nor how
Miloš Lapiš
@mlc-mlapis
Jul 10 2018 17:02
@uelton-hbsis ... HOW: There are SystemJS Config API like map, packages, bundles, ... WHAT: "unexpected token <" is the error message for such a situation and the previous line in the stack tells you which file was requested as the last one -> which is the problem.
uelton-hbsis
@uelton-hbsis
Jul 10 2018 17:03
@mlc-mlapis Thanks for the response! I believe that the problems I am facing are particular of this angular seed https://github.com/mgechev/angular-seed