plwalters / aurelia-bs-modal

DEPRECATED - Aurelia plugin for bootstrap modal
MIT License
17 stars 16 forks source link

I am getting this error in a new aurelia project #18

Closed Martin-Andersen closed 8 years ago

Martin-Andersen commented 8 years ago

Failed to load resource: the server responded with a status of 404 (Not Found) 'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead. 'webkitIndexedDB' is deprecated. Please use 'indexedDB' instead. INFO [aurelia] Aurelia Starting DEBUG [aurelia] Loading plugin github:aurelia/templating-binding@0.13.1. DEBUG [aurelia] Configured plugin github:aurelia/templating-binding@0.13.1. DEBUG [aurelia] Loading plugin github:aurelia/templating-resources@0.13.1. DEBUG [aurelia] Configured plugin github:aurelia/templating-resources@0.13.1. DEBUG [aurelia] Loading plugin github:aurelia/history-browser@0.6.1. DEBUG [aurelia] Configured plugin github:aurelia/history-browser@0.6.1. DEBUG [aurelia] Loading plugin github:aurelia/templating-router@0.14.0. DEBUG [aurelia] Configured plugin github:aurelia/templating-router@0.14.0. DEBUG [aurelia] Loading plugin github:aurelia/event-aggregator@0.6.1. DEBUG [aurelia] Configured plugin github:aurelia/event-aggregator@0.6.1. DEBUG [aurelia] Loading plugin aurelia-animator-css. DEBUG [aurelia] Configured plugin aurelia-animator-css. DEBUG [aurelia] Loading plugin aurelia-bs-modal. DEBUG [aurelia] Configured plugin aurelia-bs-modal. DEBUG [templating] importing resources for github:pwkad/aurelia-bs-modal@0.2.1/modal.html Array[0] DEBUG [templating] importing resources for github:pwkad/aurelia-bs-modal@0.2.1/modal-header.html Array[0] DEBUG [templating] importing resources for github:pwkad/aurelia-bs-modal@0.2.1/modal-body.html Array[0] DEBUG [templating] importing resources for github:pwkad/aurelia-bs-modal@0.2.1/modal-footer.html Array[0] DEBUG [templating] importing resources for github:pwkad/aurelia-bs-modal@0.2.1/au-button.html Array[0] INFO [aurelia] Aurelia Started DEBUG [templating] importing resources for app.html Array[0] Unhandled promise rejection TypeError: $(...).modal is not a function at Modal.attached (http://localhost:9000/jspm_packages/github/pwkad/aurelia-bs-modal@0.2.1/modal.js:45:27) at BehaviorInstance.attached (http://localhost:9000/jspm_packages/github/aurelia/templating@0.13.11/index.js:2061:31) at View.attached (http://localhost:9000/jspm_packages/github/aurelia/templating@0.13.11/index.js:605:22) at ViewSlot.attached (http://localhost:9000/jspm_packages/github/aurelia/templating@0.13.11/index.js:959:15) at http://localhost:9000/jspm_packages/github/aurelia/framework@0.13.3/index.js:251:30 at run (http://localhost:9000/jspm_packages/npm/core-js@0.9.18/modules/es6.promise.js:91:43) at http://localhost:9000/jspm_packages/npm/core-js@0.9.18/modules/es6.promise.js:105:11 at module.exports (http://localhost:9000/jspm_packages/npm/core-js@0.9.18/modules/$.invoke.js:6:25) at queue.(anonymous function) (http://localhost:9000/jspm_packages/npm/core-js@0.9.18/modules/$.task.js:40:9) at Number.run (http://localhost:9000/jspm_packages/npm/core-js@0.9.18/modules/$.task.js:27:7) Uncaught TypeError: $(...).modal is not a function

I am using Chrome on OS X

larsfjerm commented 8 years ago

I'm also getting kind of the same error:

TypeError: $(...).modal is not a function at Modal.attached (http://localhost:9871/wwwroot/jspm_packages/github/pwkad/aurelia-bs-modal@0.2.1/modal.js:45:27) at BehaviorInstance.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/behavior-instance.js:102:35) at View.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/view.js:157:26) at BehaviorInstance.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/behavior-instance.js:106:23) at View.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/view.js:157:26) at BehaviorInstance.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/behavior-instance.js:106:23) at View.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/view.js:157:26) at BehaviorInstance.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/behavior-instance.js:106:23) at View.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/view.js:157:26) at ViewSlot.attached (http://localhost:9871/wwwroot/jspm_packages/github/aurelia/templating@0.12.1/view-slot.js:214:19)

larsfjerm commented 8 years ago

@Martin-Andersen I solved it by

import 'bootstrap';

in app.js

Martin-Andersen commented 8 years ago

Thanks So what do you import? bootstrap.js ? Can we import it in the aurelia configuration? Yes like this

export function configure(aurelia) { aurelia.use .standardConfiguration() .developmentLogging() // Install the plugin .plugin('aurelia-animator-css') .plugin('aurelia-bs-modal') .plugin('bootstrap');;

aurelia.start().then(a => a.setRoot()); }

plwalters commented 8 years ago

Yes this was the missing bootstrap files that were needed in the parent app. I'm re-opening this so it is explicitly set in the jspm override that bootstrap is a dependency so I don't forget to add this :)

ghost commented 8 years ago

After setting up via yo aurelia

I still needed to import 'bootstrap';

in app.js

@larsfjerm: Thank you! It was very frustrating not getting the basic skeleton to work right away and your tip unblocked me.

larsfjerm commented 8 years ago

@Mauricio3000 I would recommend taking a look at https://github.com/aurelia/dialog

norgie commented 8 years ago

I tried @Mauricio3000's tip but still get TypeError: $(...).modal is not a function 0.2.3/modal.js Line 47

Is this issue fixed or is it still an error in the code?