I am getting crazy trying to load scripts like Runtime.js
and SP.js
. In the beginning I added the dependencies in the config.json as mentioned here. As usual, the Microsoft documentation is buggy and you have to be a wizard to fix the errors.
Anyway, I ended up to load the SharePoint JSOM scripts with the SPComponentLoader. In the debug it works, once deployed without -p, I get:
SP.Runtime.js:2 Uncaught Error: SP.Runtime.js is already loaded
Uncaught RangeError: Maximum call stack size exceeded
at Boolean (<anonymous>)
at SupplementDefaultMethod.window.<computed> [as OriginalOnError] (init.js:1:180299)
at ULSSendExceptionImpl (init.js:1:106758)
at ULSOnError (init.js:1:106829)
at SupplementDefaultMethod.window.<computed> [as OriginalOnError] (init.js:1:180335)
at ULSSendExceptionImpl (init.js:1:106758)
at ULSOnError (init.js:1:106829)
at SupplementDefaultMethod.window.<computed> [as OriginalOnError] (init.js:1:180335)
at ULSSendExceptionImpl (init.js:1:106758)
at ULSOnError (init.js:1:106829)
If I package the solution with -p I get:
GET https://relative-path.invalid/sp-init.js net::ERR_NAME_NOT_RESOLVED
GET https://relative-path.invalid/sp-runtime.js net::ERR_NAME_NOT_RESOLVED
GET https://relative-path.invalid/sharepoint.js net::ERR_NAME_NOT_RESOLVED
GET https://relative-path.invalid/microsoft-ajax.js net::ERR_NAME_NOT_RESOLVED
How do I import these files in order to work in all three scenarios?