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

Error with latest Aurelia #18

Open
LivesleyWA opened this issue Oct 18, 2015 · 20 comments
Open

Error with latest Aurelia #18

LivesleyWA opened this issue Oct 18, 2015 · 20 comments

Comments

@LivesleyWA
Copy link

I have other errors so the latest Aurelia release may have issues but, when I add the plugin declaration I get the following. This was working yesterday so it's something to do with Aurelia changes.

Error: Pipeline steps can only be added to the root router
at RouterConfiguration.exportToRouter (http://localhost:50082/jspm_packages/github/aurelia/[email protected]/aurelia-router.js:475:17)
at Router.configure (http://localhost:50082/jspm_packages/github/aurelia/[email protected]/aurelia-router.js:1195:26)
at Function.AddFluxPipelineStep (http://localhost:50082/jspm_packages/github/tfrydrychewicz/[email protected]/router.js:19:14)
at r.configure (http://localhost:50082/jspm_packages/github/tfrydrychewicz/[email protected]/index.js:14:31)
at http://localhost:50082/jspm_packages/github/aurelia/[email protected]/aurelia-framework.js:34:34
at run (http://localhost:50082/jspm_packages/npm/[email protected]/modules/es6.promise.js:91:43)
at http://localhost:50082/jspm_packages/npm/[email protected]/modules/es6.promise.js:105:11
at module.exports (http://localhost:50082/jspm_packages/npm/[email protected]/modules/$.invoke.js:6:25)
at queue.(anonymous function) (http://localhost:50082/jspm_packages/npm/[email protected]/modules/$.task.js:40:9)
at Number.run (http://localhost:50082/jspm_packages/npm/[email protected]/modules/$.task.js:27:7)
at listner (http://localhost:50082/jspm_packages/npm/[email protected]/modules/$.task.js:31:9)

@tfrydrychewicz
Copy link
Owner

That's been already solved. Unfortunately there is a bigger issue with new DI container. Aurelia Team will add a hook for aurelia-flux. When I have that, I'll publish new version. That should be somewhere this week.

@charlespockert
Copy link

@LivesleyWA @tfrydrychewicz there's a configure callback on the router that you want to use instead which ensures that you don't run into issues with making the router already configured when the host app tries to configure it:

router.ensureConfigured().then(() => {
      let configuration = new RouterConfiguration();
      configuration.addPipelineStep("modelbind", FluxLifeCycleStep);
      router.configure(configuration);
});

A hook on the container would be good - I made a fork to try and tackle it but it means intercepting in a couple of places and gets a little tricky (though it seems possible). Container hook would solve those problems :) look forward to getting an update

@tfrydrychewicz
Copy link
Owner

The problem with Error: Pipeline steps can only be added to the root router was caused by the DI not resolving Router with root router.

import {Router} from 'aurelia-router';
let router = aurelia.container.get(Router);

It used to do that, but it doesn't do that anymore. I thought that resolving AppRouter instead of Router should help here.

@LivesleyWA
Copy link
Author

Thanks for the above tip. It would appear that major changes have been made to routers/pipeline and, as a result, an application which was working for me on Saturday night is now broken. I have a number of issues registered, of which this is one - although I am pretty sure that they are all related to the issue identified by @tfrydrychewicz. I am waiting for stability before continuing because hitting my head against a wall has limited charms. I hope the issues are resolved this week because, if not, my choice of Aurelia over Angular will be questioned which would be a pity.

@LivesleyWA
Copy link
Author

Tomasz, Is there any update from the Aurelia team on the adjustments and likely delivery date?

@niieani
Copy link

niieani commented Nov 1, 2015

+1 on this.
Many thanks for the great work so far!

@yieme
Copy link

yieme commented Nov 1, 2015

+1

@iovergard
Copy link

Any news on this?

@EisenbergEffect
Copy link

@tfrydrychewicz We had the Beta release today. A lot of people would like to use the plugin, but it needs to be updated.

@cdennig
Copy link

cdennig commented Nov 18, 2015

+1

@victor-foster
Copy link

Any update on the status of updating this plugin to work with Aurelia Beta?

@AdamWillden
Copy link

if this is still an issue then +1 here too, I'm looking at using Aurelia and really wanted to use this plugin. @tfrydrychewicz are you looking to fix this?

@tkhyn
Copy link

tkhyn commented Dec 17, 2015

@AdamWillden you may want to try and use this fork: tkhyn/aurelia-flux

@AdamWillden
Copy link

@tkhyn after I posted I saw PR #22 which is essentially your fork - thanks for doing it!

I noticed that the PR says CI is failing. Is that anything to be concerned about or is it an issue with the CI itself do you know?

Thanks again.

@tkhyn
Copy link

tkhyn commented Dec 18, 2015

@AdamWillden it looks like it's an issue with the CI itself, that uses a version of Firefox (31) that does not seem to support some SystemJS polyfills (https://travis-ci.org/tfrydrychewicz/aurelia-flux/builds/95719298). I did not care to investigate further as all tests pass with Chrome and Firefox 42+.

@AdamWillden
Copy link

@tkhyn thanks. Just wanted that bit of confidence 👍

@tomasbonco
Copy link

Hello @tkhyn! I need to use Flux with Beta 1 and because this repo seems not to be actual, I tried to use your PR. I forked it, and made a release, but I'm still getting error:
Error: Pipeline steps can only be added to the root router
Is there any chance to get it working?

@AdamWillden
Copy link

@tomasbonco I think I did the same as you've done. jspm works with releases so you need to specify @master to get the master branch as follows:

  {
      ...
      "aurelia-flux": "github:tkhyn/aurelia-flux@master",
  }

@AdamWillden
Copy link

oh sorry I just read you made a release on your own fork. I don't know then... same error though

@tkhyn
Copy link

tkhyn commented Dec 30, 2015

@tomasbonco I have no problem when I use github:tomasbonco/[email protected] instead of github:tkhyn/aurelia-flux@master in the jspm/dependencies section of package.json and run jspm install. Just tested it on my fork of the sample aurelia-flux-todo app.

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