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

error when using child routes in a plugin #2547

Closed
mxrlkn opened this Issue Dec 22, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@mxrlkn
Copy link

mxrlkn commented Dec 22, 2018

Version

3.0.2

Reproduction link

https://codesandbox.io/s/l2zkww865q

Steps to reproduce

Open the codesandbox, open the console and click on the page1 link

What is expected?

page1 route and child route working

What is actually happening?

freezes and shows:
[Vue warn]: Error in nextTick: "RangeError: Maximum call stack size exceeded"`

In the console


I'm making a plugin for internal use that will always need vue-router with some default routes. When I tried to use child routes, I encountered the error.

If you open the vue inspector you'll see that it keeps creating new child routes inside the child routes itself repeatedly.

@posva

This comment has been minimized.

Copy link
Member

posva commented Dec 22, 2018

The line Vue.options.render = h => h(app); shouldn't be there, Vue is the constructor, not the Vue instance at the route. You will need to manually add that line to the main.js. For further questions, please use the appropriate channels like the Forum or discord chat 🙂

@posva posva closed this Dec 22, 2018

@mxrlkn

This comment has been minimized.

Copy link

mxrlkn commented Dec 23, 2018

Ahh thanks. I've added the render function to main.js, but I still get the same error. I've created a forum post for it instead 🙂
https://forum.vuejs.org/t/error-when-using-child-routes-in-a-plugin/52194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment