Open aaronfrost opened 4 years ago
It'll be helpful if you can provide a tiny repro so I can play around with it over the weekend.
This is a good point. Let me see if I can get something together for you.
Hi, I created a demo app that reproduces this problem.
It also includes a script to run guess-parser node ./scripts/routes.js
.
Thank you @suke, I'll make some time for this issue in the next a couple of days.
I can confirm I'm also seeing an issue with path resolution. lmk if you need additional details, but it sounds like the same issue.
Error: The relative path "../../collections/collections-routing.module" to "C:\Websites\gym.com\apps\gym\src\app\app.module.ts" cannot be resolved to a module
at Object.exports.getModulePathFromRoute (C:\Websites\gym.com\node_modules\guess-parser\dist\guess-parser\index.js:334:15)
at Object.exports.getRoute (C:\Websites\gym.com\node_modules\guess-parser\dist\guess-parser\index.js:570:34)
at C:\Websites\gym.com\node_modules\guess-parser\dist\guess-parser\index.js:558:28
at Array.map (<anonymous>)
at Object.exports.getRoute (C:\Websites\gym.com\node_modules\guess-parser\dist\guess-parser\index.js:554:14)
at C:\Websites\gym.com\node_modules\guess-parser\dist\guess-parser\index.js:938:34
at visitTopLevelRoutes (C:\Websites\gym.com\node_modules\guess-parser\dist\guess-parser\index.js:909:13)
at visitNodes (C:\Websites\gym.com\node_modules\typescript\lib\typescript.js:27858:30)
at Object.forEachChild (C:\Websites\gym.com\node_modules\typescript\lib\typescript.js:28032:24)
at NodeObject.forEachChild (C:\Websites\gym.com\node_modules\typescript\lib\typescript.js:146142:23)
I encountered the problem too, and explored it a little further, for example in the case of nested lazy modules. Please check the description of this issue: https://github.com/scullyio/scully/issues/1347
If my project looks like this:
And in the
app-routing
I have routes that are lazily loaded, when I do the traverseForRoutes stuff... it errors on the lazily loaded modules in the app-routing. If I move the file back to the same dir as the app.module... the error goes away.