aurelia / bootstrapper-webpack

A custom bootstrapper for using Webpack with Aurelia
MIT License
8 stars 6 forks source link

Can't require resource #8

Closed dbulic closed 8 years ago

dbulic commented 8 years ago

Hi, can't get webpack to work, and it did work before (unfortunately, can't get back to working project as I formatted the drive and cloned the previously working project from github). All dependencies are latest builds (ran npm update).

In console:

Unhandled rejection TypeError: _aureliaPal.DOM.injectStyles is not a function
    at injectAureliaHideStyleAtHead (http://localhost:4000/js/app.js:47243:20)
    at Object.configure (http://localhost:4000/js/app.js:33965:55)
    at http://localhost:4000/js/app.js:8717:35
    at tryCatcher (http://localhost:4000/js/app.js:5298:24)
    at Promise._settlePromiseFromHandler (http://localhost:4000/js/app.js:3323:32)
    at Promise._settlePromise (http://localhost:4000/js/app.js:3380:19)
    at Promise._settlePromise0 (http://localhost:4000/js/app.js:3425:11)
    at Promise._settlePromises (http://localhost:4000/js/app.js:3504:19)
    at Async._drainQueue (http://localhost:4000/js/app.js:371:17)
    at Async._drainQueues (http://localhost:4000/js/app.js:381:11)
    at Async.drainQueues (http://localhost:4000/js/app.js:250:15)
    at MutationObserver.<anonymous> (http://localhost:4000/js/app.js:4560:18)

When running webpack:

<aurelia-bootstrapper-webpack> [package.json] required "./aurelia-framework" from "aurelia-framework".
<aurelia-bootstrapper-webpack> [package.json] required "./aurelia-logging-console" from "aurelia-logging-console".
<aurelia-bootstrapper-webpack> [package.json] required "./aurelia-templating-binding" from "aurelia-templating-binding".
<aurelia-bootstrapper-webpack> [package.json] required "./aurelia-templating-resources" from "aurelia-templating-resources".
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/compose", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/if", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/with", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/repeat", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/show", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/hide", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/replaceable", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/sanitize-html", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/focus", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/binding-mode-behaviors", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/throttle-binding-behavior", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/debounce-binding-behavior", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/signal-binding-behavior", which does not exist.
[<aurelia-templating-resources>] wants to require "aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/update-trigger-binding-behavior", which does not exist.
<aurelia-bootstrapper-webpack> [package.json] required "./aurelia-templating-router" from "aurelia-templating-router".
[<aurelia-templating-router>] wants to require "aurelia-templating-router/aurelia-bootstrapper-webpack/dist/commonjs/router-view", which does not exist.
[<aurelia-templating-router>] wants to require "aurelia-templating-router/aurelia-bootstrapper-webpack/dist/commonjs/route-href", which does not exist.
<aurelia-bootstrapper-webpack> [package.json] required "./aurelia-history-browser" from "aurelia-history-browser".
<aurelia-bootstrapper-webpack> [package.json] required "./aurelia-event-aggregator" from "aurelia-event-aggregator".
jkehler commented 8 years ago

I ran into this as well. If you run npm dedupe it should fix it.

EisenbergEffect commented 8 years ago

Anytime you use Webpack, either NPM 3 or dedupe with NPM 2 is required. That's just how Webpack works. This causes the node_modules folder to have a flat package structure, which is what is required for client-side development.