aurelia / dialog

A dialog plugin for Aurelia.
MIT License
106 stars 115 forks source link

Error: Mismatched anonymous define() module on dialogService.open() #336

Closed Renaud009 closed 6 years ago

Renaud009 commented 6 years ago

I'm submitting a bug report

Current behavior: Based on documentation (welcome.js / edit-person.js) and latest Aurelia CLI (TypeScript) project I get the following error when trying to open the dialog

this.dialogService.open({ viewModel: EditPerson, model: { firstName: 'yolo' }, lock: false }).whenClosed(response => { if (!response.wasCancelled) { console.log('good - ', response.output); } else { console.log('bad'); } console.log(response.output); });

Unhandled rejection Error: Mismatched anonymous define() module: function (){return a} http://requirejs.org/docs/errors.html#mismatch at F (http://10.30.90.175:8080/scripts/vendor-bundle.js:3788:290) at P (http://10.30.90.175:8080/scripts/vendor-bundle.js:3795:139) at Object.m [as require] (http://10.30.90.175:8080/scripts/vendor-bundle.js:3807:241) at requirejs (http://10.30.90.175:8080/scripts/vendor-bundle.js:3813:233) at http://10.30.90.175:8080/scripts/vendor-bundle.js:11795:9 at DefaultLoader.loadModule (http://10.30.90.175:8080/scripts/vendor-bundle.js:11794:14) at ViewEngine.importViewModelResource (http://10.30.90.175:8080/scripts/vendor-bundle.js:19992:26) at CompositionEngine.ensureViewModel (http://10.30.90.175:8080/scripts/vendor-bundle.js:21306:32) at DialogService.ensureViewModel (http://10.30.90.175:8080/scripts/vendor-bundle.js:72739:47) at DialogService.open (http://10.30.90.175:8080/scripts/vendor-bundle.js:72808:35) at TestDragula.someEvent (http://10.30.90.175:8080/scripts/app-bundle.js:2583:32) at CallScope.evaluate (http://10.30.90.175:8080/scripts/vendor-bundle.js:5443:21) at Listener.callSource (http://10.30.90.175:8080/scripts/vendor-bundle.js:9065:42)

Expected/desired behavior: Dialog to be opened

Steps for reproduction: Create an aurelia-cli project with typescript Install the plugin: au install aurelia-dialog in main.ts, call the plugin: aurelia.use.plugin('aurelia-dialog') Try to follow the documentation here http://aurelia.io/docs/plugins/dialog#using-the-plugin