ViewUI migration build got max call stack exceeded error
Version
3.2.26
Reproduction link
Steps to reproduce
- config project (written with vue2 before) under migration build guide
- the project use ViewUI as its dependency
What is expected?
After following the migration guide, there should be no error.
What is actually happening?
Got max call stack exceeded error.
I found the error was raised in file Button.vue.
And in this line, it was meant to resolve to be a normal button, unfortunately, it resolved to self unexpectedly.
The reason was the the difference between resolveAssets(vue3) and resolveAssets(vue2).
In vue 2, there was no special handle for dynamic compnent to resolve to be itself, but vue 3 did. That was where this error came from.
For some UI lib like ViewUI, which did not use prefix for their component name, their user will be stuck by this kind of error in the way of migration build.
So I guess it's better if vue3 could keep consistent with vue2 in this point.
Vue 3's resolving logic self-resolves if the component's name option matches. That's the intended behavior. ViewUI should add a prefix to the name
option to all components that have overlapping name with native HTML elements.
Prefix-less components + native element name is explicitly prohibited in the style guide.