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

Cannot read property 'canActivate' of undefined #257

Closed
glen-84 opened this issue Mar 5, 2017 · 9 comments
Closed

Cannot read property 'canActivate' of undefined #257

glen-84 opened this issue Mar 5, 2017 · 9 comments
Assignees
Labels

Comments

@glen-84
Copy link

glen-84 commented Mar 5, 2017

I'm submitting a bug report

  • Library Version:
    1.0.0-beta.3.0.1

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    6.10.0

  • NPM Version:
    3.10.10

  • JSPM OR Webpack AND Version
    jspm 0.17.0-beta.40

  • Browser:
    all

  • Language:
    TypeScript 2.2.0

Current behavior:

When calling DialogService.open, it is no longer possible to set the viewModel to a type. A relative path doesn't work either. Only an absolute path does.

Expected/desired behavior:

It should be possible to either reference an imported type, or to use a relative path.

What is the motivation / use case for changing the behavior?

This is/was a BC break. Using an absolute path is far from ideal.


I am aware of #135, but this is not a webpack issue.

@StrahilKazlachev
Copy link
Contributor

Can you provide a repro? This is strange indeed.
Is it possible to be a SystemJS issue?

@glen-84
Copy link
Author

glen-84 commented Mar 5, 2017

Can you provide a repro? This is strange indeed.

The Gist that is provided is using an old version of this library (aurelia-dialog@0.5.7). Is there an updated version?

Is it possible to be a SystemJS issue?

No, the OP in #135 was using webpack.

@StrahilKazlachev
Copy link
Contributor

StrahilKazlachev commented Mar 5, 2017

There isn't an updated gist - sorry.
Passing a relative path for the ViewModel directly - I'm not sure if this has been supported - will check.

to set the viewModel to a type

If the following is what you meant, it should work.

import {UserInfoDialog} from './dialog/user'; 
// ...
this.dialogService.open({viewModel: UserInfoDialog}) // ...
// ...

I'm adding this to my TODO list for the next release.
Repro is still welcomed.

@glen-84
Copy link
Author

glen-84 commented Mar 7, 2017

@StrahilKazlachev
Copy link
Contributor

@glen-84 When passing a relative path it must be relative to the app root, in SystemJS the baseURL.
Why using the class doesn't work, I'm not sure.
@PWKad In the repro when a class is provided to the viewModel setting, Origin.get fails to resolve the origin because System._loader.modules is undefined. The sample in the master branch is also providing the viewModel as class and it works. But it is using SystemJS@0.19.x not 0.20.x(repro).

@StrahilKazlachev
Copy link
Contributor

Tracked in aurelia/loader-default#40

@glen-84
Copy link
Author

glen-84 commented Dec 7, 2017

@StrahilKazlachev,

This is still not working. I get Can not resolve "moduleId" of "ArticlesDelete".

@StrahilKazlachev
Copy link
Contributor

@glen-84 do you reproduce it with the previous repro you provided?
Also can you check you have loader-default@1.0.3 - especially if you have any lock file?

@glen-84
Copy link
Author

glen-84 commented Dec 10, 2017

I just updated the repro (locally), and it's now working.

I guess there is some other issue with my app.

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

No branches or pull requests

3 participants