Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View only routes importing incorrectly #42

Open
smuszel opened this issue Aug 11, 2018 · 2 comments
Open

View only routes importing incorrectly #42

smuszel opened this issue Aug 11, 2018 · 2 comments

Comments

@smuszel
Copy link

smuszel commented Aug 11, 2018

I'm submitting a bug report

  • Library Version:
    2.2.1

Please tell us about your environment:

  • Operating System:
    Windows 8.1

  • Node Version:
    10.8.0

  • NPM Version:
    6.2.0
  • JSPM OR Webpack AND Version
    webpack 4.16.5
  • Browser:
    all
  • Language:
    TypeScript 3.01

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:

  • What is the expected behavior?

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

According to feature aurelia/templating-router#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
Copy link
Contributor

jods4 commented Aug 13, 2018

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
Copy link

@smuszel will you please follow up on your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants