aurelia / loader-webpack

An implementation of Aurelia's loader interface to enable webpack.
MIT License
26 stars 10 forks source link

Can't resolve 'aurelia-loader-context' #11

Closed heruan closed 8 years ago

heruan commented 8 years ago

I'm new to webpack and I set up a very simple project with just this index.js:

import {bootstrap} from "aurelia-bootstrapper-webpack";
import {Aurelia} from "aurelia-framework";

bootstrap(async (aurelia) => {
    aurelia.use.standardConfiguration().developmentLogging();
    await aurelia.start();
    aurelia.setRoot("app", document.body);
});

but trying to bundle with webpack I get this warning:

WARNING in ./~/aurelia-loader-webpack/dist/commonjs/aurelia-loader-webpack.js
Module not found: Error: Can't resolve 'aurelia-loader-context' @ ./~/aurelia-loader-webpack/dist/commonjs/aurelia-loader-webpack.js 104:25-66

and if I ignore it and run the app in the browser I get this:

bundle.js:624 Uncaught (in promise) Error: Cannot find module "aurelia-loader-context"
    at webpackMissingModule (http://localhost:8888/bundle.js:624:71)
    at http://localhost:8888/bundle.js:624:170
heruan commented 8 years ago

Using AureliaWebpackPlugin in webpack.config.js solves this, and I also understood the use of packages.json/aurelia/build/resources. I now get this instead:

<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.

where it seems to be an incorrect aurelia-bootstrapper-webpack string in the path, e.g. in

aurelia-templating-resources/aurelia-bootstrapper-webpack/dist/commonjs/compose

which does not exists but

aurelia-templating-resources/dist/commonjs/compose

does.

heruan commented 8 years ago

Related to https://github.com/aurelia/webpack-plugin/issues/39.