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

Maximum call stack size exceeded when use nuxt@3.11.1 #2892

Closed
ausir0726 opened this issue Apr 2, 2024 · 6 comments
Closed

Maximum call stack size exceeded when use nuxt@3.11.1 #2892

ausir0726 opened this issue Apr 2, 2024 · 6 comments

Comments

@ausir0726
Copy link

Environment


  • Operating System: Windows_NT
  • Node Version: v20.12.0
  • Nuxt Version: 3.11.1
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.5
  • Package Manager: pnpm@8.15.6
  • Builder: -
  • User Config: devtools, modules
  • Runtime Modules: @nuxtjs/i18n@8.2.0
  • Build Modules: -

Reproduction

a empty nuxt 3 starter project
install nuxt-i18n and console.log(locale)

<script setup>
const { locale } = useI18n();
console.log(locale);
</script>

Describe the bug

when I use nuxt@3.11.1
I console.log(locale)
the page crash ( Maximum call stack size exceeded )

it's works nuxt@3.10

Additional context

at Array.map ()
at stringify (/C:/Users/ausir/test/nuxt-pppp/node_modules/.pnpm/@nuxt+devalue@2.0.2/node_modules/@nuxt/devalue/dist/devalue.mjs:114:39)
at /C:/Users/ausir/test/nuxt-pppp/node_modules/.pnpm/@nuxt+devalue@2.0.2/node_modules/@nuxt/devalue/dist/devalue.mjs:91:58
at Array.map ()
at stringify (/C:/Users/ausir/test/nuxt-pppp/node_modules/.pnpm/@nuxt+devalue@2.0.2/node_modules/@nuxt/devalue/dist/devalue.mjs:91:31)
at Array.map ()
at stringify (/C:/Users/ausir/test/nuxt-pppp/node_modules/.pnpm/@nuxt+devalue@2.0.2/node_modules/@nuxt/devalue/dist/devalue.mjs:96:50)
at /C:/Users/ausir/test/nuxt-pppp/node_modules/.pnpm/@nuxt+devalue@2.0.2/node_modules/@nuxt/devalue/dist/devalue.mjs:91:58
at Array.map ()

Logs

No response

Copy link

github-actions bot commented Apr 2, 2024

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 Reproduction starter (v8 and higher)
👉 Reproduction starter (edge)

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

@ausir0726
Copy link
Author

I am unable to reproduce the issue in stackblitz,
but it does occur on my WIN/MAC OS.
Still trying to figure out the problem.

@ausir0726
Copy link
Author

@BobbieGoede

Finally, I was able to reproduce the error in Codesandbox.
It seems that the error can only be reproduced on node v20
(but in my local env, I use node v18 got same error)

https://codesandbox.io/p/devbox/fancy-wave-7tjy7r

------------------------------
- Operating System: Linux
- Node Version:     v20.9.0
- Nuxt Version:     3.11.1
- CLI Version:      3.11.1
- Nitro Version:    2.9.6
- Package Manager:  npm@9.8.1
- Builder:          -
- User Config:      devtools, modules
- Runtime Modules:  @nuxtjs/i18n@8.3.0
- Build Modules:    -
------------------------------

@ausir0726
Copy link
Author

Additional information

Everything is normal when using 3.10.3.

<ref *1> ComputedRefImpl {
  getter: [Function: get],
  _setter: [Function: set],
  dep: undefined,
  __v_isRef: true,
  __v_isReadonly: false,
  effect: ReactiveEffect {
    fn: [Function (anonymous)],
    trigger: [Function (anonymous)],
    scheduler: undefined,
    active: true,
    deps: [ [Map] ],
    _dirtyLevel: 0,
    _trackId: 1,
    _runnings: 0,
    _shouldSchedule: false,
    _depsLength: 1,
    computed: [Circular *1]
  },
  _cacheable: true,
  _value: 'en-US'
}

When using 3.11.0, there are no error messages displayed (have WARN), but the screen does not render (only displaying NUXT LOGO)

<ref *1> ComputedRefImpl {
  getter: [Function: get],
  _setter: [Function: set],
  dep: undefined,
  __v_isRef: true,
  __v_isReadonly: false,
  effect:
   ReactiveEffect {
     fn: [Function (anonymous)],
     trigger: [Function (anonymous)],
     scheduler: undefined,
     active: true,
     deps: [ [Map] ],
     _dirtyLevel: 0,
     _trackId: 1,
     _runnings: 0,
     _shouldSchedule: false,
     _depsLength: 1,
     computed: [Circular *1] },
  _cacheable: true,
  _value: 'en-US' }

 WARN  Cannot stringify arbitrary non-POJOs ComputedRefImpl

When using 3.11.1, an error occurs.

<ref *1> ComputedRefImpl {
  getter: [Function: get],
  _setter: [Function: set],
  dep: undefined,
  __v_isRef: true,
  __v_isReadonly: false,
  effect:
   ReactiveEffect {
     fn: [Function (anonymous)],
     trigger: [Function (anonymous)],
     scheduler: undefined,
     active: true,
     deps: [ [Map] ],
     _dirtyLevel: 0,
     _trackId: 1,
     _runnings: 0,
     _shouldSchedule: false,
     _depsLength: 1,
     computed: [Circular *1] },
  _cacheable: true,
  _value: 'en-US' }

 WARN  Cannot stringify arbitrary non-POJOs ComputedRefImpl


 ERROR  [nuxt] [request error] [unhandled] [500] Maximum call stack size exceeded
  at Map.has (<anonymous>)
  at stringify (/C:/Users/ausir/test/nuxt-pppp/node_modules/@nuxt/devalue/dist/devalue.mjs:74:15)
  at /C:/Users/ausir/test/nuxt-pppp/node_modules/@nuxt/devalue/dist/devalue.mjs:91:58
  at Array.map (<anonymous>)
  at stringify (/C:/Users/ausir/test/nuxt-pppp/node_modules/@nuxt/devalue/dist/devalue.mjs:91:31)
  at /C:/Users/ausir/test/nuxt-pppp/node_modules/@nuxt/devalue/dist/devalue.mjs:114:71
  at Array.map (<anonymous>)
  at stringify (/C:/Users/ausir/test/nuxt-pppp/node_modules/@nuxt/devalue/dist/devalue.mjs:114:39)
  at /C:/Users/ausir/test/nuxt-pppp/node_modules/@nuxt/devalue/dist/devalue.mjs:91:58
  at Array.map (<anonymous>)

@BobbieGoede
Copy link
Collaborator

It looks like this is related to the devLogs feature, it starts working again when disabling it by adding features: { devLogs: false } do the Nuxt config.

Not sure if this is necessarily an issue caused by this module or caused by the way values are stringified by this feature 🤔 Will have to check if there's an existing issue on the Nuxt repo later.

@ausir0726
Copy link
Author

According to
nuxt/nuxt#26605 (comment)

Should be fixed via nuxt/nuxt#26503 on nightly

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

No branches or pull requests

2 participants