nuxt-community / vuetify-module

Vuetify Module for Nuxt 2
Other
629 stars 106 forks source link

Maximum call stack size exceeded when using optionsPath #311

Open edouardgab opened 4 years ago

edouardgab commented 4 years ago

Hi there! 👋

I am having an issue when optionsPath in Vuetify options from nuxt.config.js.

It took some time to link the issue with that but when migrating Vuetify options to another file using optionsPath, it "randomly" breaks the site returning the following error: Maximum call stack size exceeded.The deepMerge function from Vuetify seems to loop. From there, the only option I have is to stop compile and start yarn dev back. It works for a while, until it breaks after a few reload.

I need to move the options outside of Nuxt.config.js to be able to import custom icons from components.

Do you have any idea of my might be causing this? I am happy to share more information if your need.

Thanks,

Ed

sugoidesune commented 4 years ago

I have wondered about this! It took me a while to realize that with each reload of the page, the server component uses up more memory. After ~30 reloads my server crashes. Very annoying since this is happening in two projects.

Great job tracing it to the optionsPath. I will try to reproduce it and will update!

Jozaguts commented 3 years ago

I have the same problem Can you fix it?

Isitar commented 2 years ago

any update on this? experiencing a similar issue

Isitar commented 2 years ago

alright i'm back from my deep dive in vuetify js library: the problem is not directly related to optionsPath, it's related to the overwriting of icons. I guess you both did something like this:

...
component: FontAwesomeIcon,
props: {
    icon: ['fas', 'fa-home'],
}
...

the problem occours with FontAwesomeIcon.

In vuetify this line: this.use(services.Icons) in framework.ts triggers the whole chain. it will call this:

parent.preset = mergeDeep(
      mergeDeep(defaultPreset, globalPreset),
      preset
    ) as VuetifyPreset

which will try to mergeDeep the defaults with the settings. (notice first call fo mergeDeep). Then there comes the problem with mergeDeep and FontAwesomeIcon. FontAwesomeIcon is a component and (i think because of nuxt) has the property components. this property contains all components from the application (or maybe only the loaded ones). anyway this will then blow up after a few rebuilds.