Skip to content
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

Alias is not resolved for compose view-model with class reference #152

Open
zakjan opened this issue Jul 27, 2018 · 1 comment
Open

Alias is not resolved for compose view-model with class reference #152

zakjan opened this issue Jul 27, 2018 · 1 comment

Comments

@zakjan
Copy link

zakjan commented Jul 27, 2018

I'm submitting a bug report

  • Library Version:
    3.0.0

Please tell us about your environment:

  • Operating System:
    OSX 10.13.5

  • Node Version:
    9.11.1

  • NPM Version:
    6.2.0

  • JSPM OR Webpack AND Version
    Webpack 4.16.2

  • Browser:
    Chrome 68

  • Language:
    ESNext

Current behavior:
Alias is not resolved for compose view-model with class reference.

I tried to follow https://github.com/aurelia/webpack-plugin/wiki/Debugging-missing-modules#using-webpack-alias-config but no success.

Steps to replicate:

$ au new test

Edit files:

webpack.config.js

Add

    alias: {
      "@root": srcDir
    }

app.js

import {PLATFORM} from "aurelia-framework";
import {Item} from "@root/item";
PLATFORM.moduleName("@root/item");

export class App {
  Item = Item;

  constructor() {
    this.message = 'Hello World!';
  }
}

app.html

<template>
  <h1>${message}</h1>

  <compose view-model.bind="Item"></compose>
</template>

item.js

export class Item {}

item.html

<template>
    Hi
</template>

Run the app

npm start

Error is thrown:

Unhandled rejection Error: Unable to find module with ID: @root/item.html

Expected/desired behavior:

  • What is the expected behavior?
    No error, component is displayed
@zakjan zakjan changed the title Alias is not resolved Alias is not resolved for compose view-model Jul 27, 2018
@zakjan zakjan changed the title Alias is not resolved for compose view-model Alias is not resolved for compose view-model with class reference Jul 27, 2018
@pat841
Copy link

pat841 commented Sep 13, 2018

Please try #139 and see if that fixes your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants