Subscribe on changes!

ViewUI migration build got max call stack exceeded error

avatar
Jan 10th 2022

Version

3.2.26

Reproduction link

jsfiddle.net/pqmaxg8w/4/

Steps to reproduce

  1. config project (written with vue2 before) under migration build guide
  2. 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.

avatar
Jan 21st 2022

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.

avatar
Jan 21st 2022

sorry to comment under a closed issue, but If I want to continue to use the migration build, is there a possible workaround for this case ?@yyx990803