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

DevAliases cause waring/error to be shown in console #99

Open
ivanbacher opened this issue Mar 4, 2024 · 3 comments
Open

DevAliases cause waring/error to be shown in console #99

ivanbacher opened this issue Mar 4, 2024 · 3 comments

Comments

@ivanbacher
Copy link
Contributor

ivanbacher commented Mar 4, 2024

When creating a new project using npx makes aurelia a webpack.config file is created.

It has this line in it:

alias: production ? {
  // add your production aliases here
} : {
  ...getAureliaDevAliases()
  // add your development aliases here
}

However, since beta 12. I get this warning/error in the console:

main.js:6 [DEV:aurelia] Error: AUR0153: Element {{0}} has already been registered.

I am only importing router-lite.

This solves the issue and does not seem to break anything.

alias: production ? {
  // add your production aliases here
} : {
  // ...getAureliaDevAliases()
  // add your development aliases here
}

is this getAureliaDevAliases() needed? What does it do?

@bigopon
Copy link
Member

bigopon commented Mar 4, 2024

Thanks @ivanbacher , since beta 12, there will be warning when theres a duplicate registration. Thats what the line is about. Though i missed the name of the element being registered so it appears as {{0}}. There will be a dev version with this fixed.

@bigopon
Copy link
Member

bigopon commented Mar 4, 2024

And for your main question: the get dev aliases is very useful during development as it gives clear description of what some errors are, in contrast to production mode where you only see the error code. A bit more info can be found at https://docs.aurelia.io/developer-guides/error-messages

@ivanbacher
Copy link
Contributor Author

Super. Thanks for the info.

So that means I can just ignore the Element has already been registered warning during development?

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

2 participants