How to debug requireJS module, specific path / file

I am new to RequireJS. I get a Load Timeout error for one of the modules that I already defined in the main file. I don’t see any requests on the Network tab in Chrome, possibly because require has already downloaded this file before.

I connected to the onError require event, and I see an error. But the stack does not give the exact location / name of the file that this module tried to load. Is there a way to determine the exact file / linesOfCode?

Also, is there any way to find out at runtime all the paths defined in requireJS, some APIs such as require.getPaths()

+7
javascript requirejs require
source share
1 answer
 requirejs.s.contexts._.config.paths 

This will return all the paths defined in requirejs. If there are multiple .config calls, they appear to contain all without duplicates.

+12
source share

All Articles