-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Unable to find module with ID for aurelia-validation plugin #99
Comments
Change to: .plugin(PLATFORM.moduleName('aurelia-validation')) You need to indicate to webpack which strings are actually module names that will be loaded by It serves two purposes:
If you look into your bundle you would see that Webpack renamed More background: https://github.com/aurelia/webpack-plugin/wiki/Managing-dependencies |
Oh wow I totally missed that well done wiki... My apologies! Thank you for your patience with explaining it and pointing me in the right direction. It wouldn't be a bad idea to even put a link to the wiki in the readme so others don't miss it as easily as I did |
@jods4 How would I go about dynamically including plugins then? aurelia-config uses .plugin, should it then check if the environment is using webpack? How do I get that to work? |
Depends what you mean exactly:
|
@jods4 I should clarify. aurelia-config does the .plugin() calls for you. Webpack now seems to need special treatment with |
@RWOverdijk I'm not familiar with |
@jods4 I just told you. It does the .plugin() calls for you. aurelia.use.plugin(). |
Surprisingly, I'll need more info. |
possible go look at my codebase, and see if that helps you figure out how to do it. |
@jods4 I've sent you a message on gitter. But for others: https://github.com/SpoonX/swan-example-client/blob/master/src/scripts/main.js#L21,L30 This is an example. It uses those strings to load and configure plugins. @JoshuaVSherman I don't think it's entirely the same. You're also using |
extremely inconvenient API! |
Current behavior:
Everything works well, until I try to add the "aurelia-validation" plugin. Even though bundling works without error, once I run my fairly minimalistic app, I get the following error:
It appears that the plugin cannot be located when aurelia is being configured in main.js:
This is especially curious because I can use
import { ValidationControllerFactory, ValidationRules, validateTrigger } from 'aurelia-validation'
just fine within one of my pages if I comment out the plugin initialization line in main.js. (Of course, if I try to do anything with the imported values it errors, saying I need to add the plugin call, as expected).I've tried adding lines to the build resources in package.json to no avail, and tried adjusting my webpack.config to no end. Any help or point in the right direction would be very much appreciated!
For reference, the webpack.config.js file that I am using is here:
https://gist.github.com/dasch88/e4a6301d718515d496ced4fa8c1ba279
The text was updated successfully, but these errors were encountered: