aurelia / router

A powerful client-side router.
MIT License
120 stars 115 forks source link

bug: Routing fails when default view is named "module" #446

Open dkent600 opened 7 years ago

dkent600 commented 7 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: See the attached gist

You will find that the default view will not render. In the console one sees the javascript error message:

aurelia.js:14435 ERROR [app-router] Error: Cannot determine default view strategy for object. at ViewLocator.getViewStrategy (aurelia.js:9143) at RouterView.process (aurelia.js:18215) at _loop (aurelia.js:15809) at NavigationInstruction._commitChanges (aurelia.js:15824) at CommitChangesStep.run (aurelia.js:15676) at next (aurelia.js:15645) at iterate (aurelia.js:16753) at processActivatable (aurelia.js:16756) at ActivateNextStep.run (aurelia.js:16637) at next (aurelia.js:15645)

If you rename the module.html and module.js to any base file name but "module", and modify the route accordingly in app.js, then all works fine.

Expected/desired behavior:

Ability to navigate to a view should not depend on the spelling of the view/module files as long as routing is properly configured.

EisenbergEffect commented 7 years ago

module is a reserved word in JavaScript. I'm suspicious that that is related to this. I'm not sure if we'll be able to fix it. It's not going to be high priority. Feel free to submit a PR with a fix.

Alexander-Taran commented 2 years ago

@bigopon 🤷‍♂️