# Decorators are not valid here

**URL:** <https://discourse.aurelia.io/t/decorators-are-not-valid-here/5459>\
**Category:** Help Requests\
**Created:** [June 14, 2024, 12:59pm UTC](https://discourse.aurelia.io/t/decorators-are-not-valid-here/5459 "2024-06-14T12:59:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![norgie](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@norgie](https://discourse.aurelia.io/u/norgie)\
**Post date:** [June 14, 2024, 12:59pm UTC](https://discourse.aurelia.io/t/decorators-are-not-valid-here/5459/1 "2024-06-14T12:59:11Z")

</div>

I’ve got this piece of code

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

As you can see the @IRouter decorator is marked with a red squiggly and the message is `Decorators are not valid here`. As far as I know what I’ve got here is similar to what’s in the docs. This application is written with `Aurelia 2 beta 18` and `webpack 5.91.0`. I’ve got another application written with Aurelia 2 beta 1 and an older webpack version than above and there I don’t get the above mentiond error .

Any ideas, anyone?

TIA

---

<div class="post-metadata">

**Author:** ![mroeling](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/mroeling/32/781_2.png) [@mroeling](https://discourse.aurelia.io/u/mroeling)\
**Post date:** [June 14, 2024, 2:54pm UTC](https://discourse.aurelia.io/t/decorators-are-not-valid-here/5459/2 "2024-06-14T14:54:09Z")

</div>

It’s your editor complaining here, I guess `vcode`?  
Do you use something like `eslint` to validate your code? What is the version of that package in your project?

It looks like a mismatch between the versions that are used for validation, versus the version of typescript / aurelia, and/or configuration error.

---

<div class="post-metadata">

**Author:** ![davidsk](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/davidsk/32/930_2.png) [@davidsk](https://discourse.aurelia.io/u/davidsk)\
**Post date:** [June 14, 2024, 3:05pm UTC](https://discourse.aurelia.io/t/decorators-are-not-valid-here/5459/3 "2024-06-14T15:05:42Z")

</div>

Parameter decorators are not supported as of beta15. More info here: [Release v2.0.0-beta.15 · aurelia/aurelia · GitHub](https://github.com/aurelia/aurelia/releases/tag/v2.0.0-beta.15)

---

<div class="post-metadata">

**Author:** ![norgie](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@norgie](https://discourse.aurelia.io/u/norgie)\
**Post date:** [June 17, 2024, 9:46am UTC](https://discourse.aurelia.io/t/decorators-are-not-valid-here/5459/4 "2024-06-17T09:46:38Z")

</div>

Fortunately I’m using the latest version of Typescript and my tsconfig.json file already had the recommended changes, so the only thing missing was the use of Aurelia’s `resolve` function. Changed my code and now the error is gone.

Thanks for your help, @davidsk 🙂

norgie
