# Aurelia Direct Router: Error on router.load(...)

**URL:** <https://discourse.aurelia.io/t/aurelia-direct-router-error-on-router-load/4576>\
**Category:** Uncategorized\
**Created:** [January 30, 2022, 6:23pm UTC](https://discourse.aurelia.io/t/aurelia-direct-router-error-on-router-load/4576 "2022-01-30T18:23:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefan](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/stefan/32/1162_2.png) [@stefan](https://discourse.aurelia.io/u/stefan)\
**Post date:** [January 30, 2022, 6:23pm UTC](https://discourse.aurelia.io/t/aurelia-direct-router-error-on-router-load/4576/1 "2022-01-30T18:23:12Z")

</div>

Hi,

when calling `router.load("...")` this results in the following error:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/d/dabc01950f782d8a553ed4f3f13f8ed01955a0e9.png)

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/1/13e62562ff9e502c642bdbc5e530e6c2a7c0d06f.png)

The “dummy-page” is imported in the html.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/1/146f17e9090b3e047e44885b8cf06e1cc71059a2.png)

Also `<a load="dummy-page">` results in error when placed in “welcome-page”. It only works in the app.html where the au-viewport is placed.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/0/050ee9d461db149b28340a3c128275293aec2072.png)

I’ve registered the direct router in the main.ts:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/1/12139e76ffcad550d7ffa0b297ecbf081cd5d45f.png)

Any idea what I’m missing?  
Thanks!

---

<div class="post-metadata">

**Author:** ![jwx](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jwx/32/507_2.png) [@jwx](https://discourse.aurelia.io/u/jwx)\
**Post date:** [January 30, 2022, 9:45pm UTC](https://discourse.aurelia.io/t/aurelia-direct-router-error-on-router-load/4576/2 "2022-01-30T21:45:06Z")

</div>

First of all, in order to be using the direct router you need to import `IRouter` from `aurelia-direct-router`, not from `aurelia`.

Second, when calling `.load()` don’t add the `path:` part, just the component(s) you want to load.

Finally, when using relative routing, as in not starting the route with a `/`, the routing/viewport context of where the router starts looking for a viewport is the routing context of where the link is. If you want to load a component in the same viewport as the component with the link using a relative route, you’ll need first step up one routing/viewport context: `../dummy-page`. (Or use an absolute route to start in the root routing/viewport context: `/dummy-page`.)

---

<div class="post-metadata">

**Author:** ![stefan](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/stefan/32/1162_2.png) [@stefan](https://discourse.aurelia.io/u/stefan)\
**Post date:** [January 31, 2022, 6:42am UTC](https://discourse.aurelia.io/t/aurelia-direct-router-error-on-router-load/4576/3 "2022-01-31T06:42:36Z")

</div>

Hi jwx,

thanks for your help! I really appreciate it.

The information to import from `aurelia` instead of `aurelia-direct-router` I got from the help page ([Navigating With Load - aurelia-direct-router](https://jwx.gitbook.io/aurelia-direct-router/routing/navigating-with-load)). Maybe this is no longer up to date?

Also the use of `path` is written in this help page. However, I am not sure anymore what exactly is the meaning behind it. Can you give me a small example of when to work with “path”?
