aurelia / loader-webpack

An implementation of Aurelia's loader interface to enable webpack.
MIT License
26 stars 10 forks source link

View only routes importing incorrectly #42

Open smuszel opened 5 years ago

smuszel commented 5 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior:

When directing to html templates as module id in routes: routes = [{ moduleId: PLATFORM.moduleName('foo.html'), }]

this._import(moduleId, defaultHMR) in method loadModule in WebpackLoader returns rejected promise with value Error: Unable to find module with ID: ./foo.html at WebpackLoader

Expected/desired behavior:

Everything works correctly if .html suffix is omited and new file foo.ts with empty class inside it is created.

According to feature https://github.com/aurelia/templating-router/pull/25 using only html views should work. Implementation of this feature was done by dynamically creation empty of class and it seems that loader is not aware of it happening.

jods4 commented 5 years ago

Can you look at webpack --display-modules and tell me: (a) If foo.html is included somewhere in your output? (b) If so, what is the full module name in the bundle?

It would help if you could provide a minimal repro in some github repo or elsewhere. Your issue might be related to many things, starting with your Webpack config. Without further information it can take a very long time -- or it's not even possible -- to diagnose such issues.

Alexander-Taran commented 5 years ago

@smuszel will you please follow up on your issue?