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

Dynamic composition - webpack "Unable to find module with ID" #131

Closed
charlessolar opened this issue Nov 7, 2017 · 3 comments
Closed

Dynamic composition - webpack "Unable to find module with ID" #131

charlessolar opened this issue Nov 7, 2017 · 3 comments

Comments

@charlessolar
Copy link

I'm seeing maybe a previously reported issue: #56 except in my case dynamic compose doesn't work at all.

I forked and modified the skeleton-typescript-webpack to illustrate
https://github.com/volak/aurelia-compose-issue

The problem is in welcome.html line

<compose view-model="test/${selectedTest}"></compose>

Webpack reports Unhandled rejection Error: Unable to find module with ID: test/hello

I'm sure its something to do with test/hello not being included because its never referenced or something - but from other comments in similar dynamic composition issues this should be supported I believe?

@jods4
Copy link
Contributor

jods4 commented Nov 8, 2017

<compose view-model> is only processed if it's static.
For example in your case we don't try to pull every possible file in test/**/*. That would work but could also quickly pull in unwanted stuff (there's a way to do that if you want, though).

There's a full discussion of dynamic compose and several options in this issue: aurelia/skeleton-navigation#810.
I'm sorry there are lots of comments over there. I want to write a page about this in the wiki but haven't come to do so yet. Look at my first answer for a good starting point.

As this is a duplicate of that other issue I'm going to close this but feel free to comment if you found an acceptable solution over there or not.

@jods4 jods4 closed this as completed Nov 8, 2017
@charlessolar
Copy link
Author

The listed solutions will work for me - but I'm surprised its not in the docs because its been confusing. Not being an expert in webpack I was sure webpack was not including the module but had no idea how this plugin was handing dynamic composition.

Issue is over in skeleton navigation of all places too - well now at least there's another link to it for future people.

@jods4
Copy link
Contributor

jods4 commented Nov 8, 2017

Yeah, sorry about that,.
I have a list of 6 topics scattered in issues that I want to add to the wiki this being one of them.
Just need to find some time to redact them.

Glad it worked out for you.

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

2 participants