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

Module causes memory leak in Nuxt 3 with asyncContext enabled #1664

Open
daniluk4000 opened this issue May 21, 2024 · 1 comment
Open

Module causes memory leak in Nuxt 3 with asyncContext enabled #1664

daniluk4000 opened this issue May 21, 2024 · 1 comment
Labels

Comments

@daniluk4000
Copy link

Description

Simple module installation in Nuxt causes memory leak with asyncContext enabled

Minimal Reproducible Example

https://github.com/daniluk4000/recaptcha-memory-leak (latest node 18 or higher)

  1. yarn install
  2. yarn debug
  3. open chrome://inspect, open profiler for node app
  4. bomb app, ex. siege -c 1 http://localhost:3000
  5. enjoy memory leak
  6. remove module
  7. retry 2-4
  8. leak is gone

System info

  • Operating System: Linux
  • Node Version: v22.1.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, experimental, modules, runtimeConfig
  • Runtime Modules: vue-recaptcha/nuxt
  • Build Modules: -
@daniluk4000
Copy link
Author

daniluk4000 commented May 21, 2024

@DanSnow

image

This code in plugin causes memory leak on SSR. Simple typeof window check fixes this error.

Also maybe module should not initialize all those wait things on SSR at all.

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

No branches or pull requests

1 participant