Comments (7)
So far, from what I see, this issue boils down to the router.load
with the following differences:
- Working:
router.load({ id: 'recipe-details', parameters: { recipeId: '52767' } }) // or router.load({ id: 'recipe-details', parameters: { recipeId: '52767' } }, { origin: undefined })
- not working:
router.load({ id: 'recipe-details', parameters: { recipeId: '52767' } }, { origin: the_anchor_with_href_to_the_recipe_page })
It means the presence of the origin
, which is the <a>
element, in the router.load
options breaks it.
cc @jwx
from aurelia.
@migajek I clicked on the normal link, clicking on the underlined link gave me the same errors, thanks!
from aurelia.
Have you tried changing parameters.bind
to params.bind
?
From the docs:
And where things start to get interesting is when you want to pass parameters to a route. We use the params configuration property to specify parameters.
from aurelia.
@johnmanko unfortunately the docs is simply wrong on this, as stated in the comment here by @jwx :
#1835 (comment)
In router, the load bindables are id and parameters
This seems to be indeed the case:
@bindable public parameters?: Parameters;
...
@bindable public id?: string;
https://github.com/aurelia/aurelia/blob/master/packages/router/src/resources/load.ts#L17
from aurelia.
Did a little debugging.
The LinkHandler
that does the actual router.load
when the a
is clicked, receives the following call:
This ends up with the following error
However when I call the similar load
directly from the controller code (so I use <a click.trigger="myMethod(..
instead of <a load="id: .., parameters.bind: ..
) it loads fine.
the only obvious difference, except for the call context, is the lack of { origin: target }
in my controller call.
Now, when I added the {origin: $event.target}
to mimic the LinkHandler
behavior, I'm getting the exact same exception.
But why? Well, that's beyond my understanding :)
from aurelia.
This is the log I get after clicking around in the recipes page:
Stackblitz is at https://stackblitz.com/edit/au2-conventions-vbk6gr
Everything seems to work fine, I'm using beta-13 though. Can you help try repro again @migajek ?
from aurelia.
@bigopon I ran yours repro, headed to recipes and clicked the underlined item. This is what I ended up with:
please note I haven't touched anything.
I tried it in 3 browsers:
- Chrome 122
- Firefox 121
- Edge 122
all running Windows 10.
Also checked in incognito mode of Chrome and Firefox just to make sure.
Each time I'm getting the error as in the screenshot above.
What browser are you running? Are you sure you clicked the underlined link of the recipe? The underlined links for each recipe (on the right hand side) are supposed to repro the bug; the regular links work just fine
from aurelia.
Related Issues (20)
- flickering caused by aurelia rendering content before clearing the old HOT 2
- [RFC] Custom element bindables take priority over custom attribute
- [refactor] remove define life cycle HOT 1
- Vite plugin for aurelia 1.x? HOT 4
- Injecting IHttpClient error after beta 11 update
- Router swallows DI errors HOT 7
- Restrict behavior of custom attribute single value binding and primary bindable HOT 8
- Tweak aurelia package reexports HOT 9
- Validation Package - Email validation HOT 7
- Replacing view factory containers
- Vite load issue. HOT 2
- Define `ts-jest` config under `globals` is deprecated HOT 2
- 2.0.0-beta.15 - using @inject is throwing errors HOT 3
- CSS modules support for Vite HOT 10
- [DEV:aurelia] Error: AUR0153: Element has already been registered HOT 8
- Variables getting removed from production bundle HOT 11
- [RFC] synchronous vs asynchronous binding system for Aurelia 2 HOT 9
- 2.0.0-beta.12 - Custom elements instances are now different HOT 10
- [feature request] ability to typecheck template
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aurelia.