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

Process hangs if an error occurs during server-side rendering #351

Open
klausXR opened this issue May 23, 2022 · 0 comments
Open

Process hangs if an error occurs during server-side rendering #351

klausXR opened this issue May 23, 2022 · 0 comments

Comments

@klausXR
Copy link

klausXR commented May 23, 2022

Environment

Reproduction

https://github.com/klausXR/nuxt-ssr-reproduction

To reproduce the bug, run npm install and npm run dev and issue a request, the process should hang and start consuming more memory

How the repository was created

  1. Create a nuxt 2 app as described here https://nuxtjs.org/docs/get-started/installation/
  2. Install bridge packages and modify run scripts as described here https://v3.nuxtjs.org/bridge/overview

For the reproduction of the bug, I have added the tailwindcss module and a postcss.config file. The config file causes something to throw an error, which I guess is not handled properly because it causes the process to hang

Describe the bug

I'm in the process of migrating an existing Nuxt 2 app to Nuxt Bridge.

When I run the development build ( set PORT=8040&& nuxi dev ), if an error occurs during server-side rendering, the process hangs in what appears to be an infinite loop of rethrowing the same error.

If nothing goes wrong server-side, it does work.

Additional context

Here's a screenshot from vscode's debugger

image

no matter how many times I press resume here, it will not deliver a failed response to the client. Instead, the process hangs indefinitely and when it reaches the 4gb memory limit, it crashes.

This happened multiple times because of migrating packages from CJS->ESM. When a package had the incorrect format, I always got the same issue.

This particular problem visible on the image is due to an invalid postcss.config file ( it was easy to reproduce ) but it happens for any error, as I mentioned.

I tried with a minimal nuxt.config file and disabling plugins/middleware/modules, but nothing fixes it

Bridge version - npm:@nuxt/bridge-edge@^3.0.0-27545203.75e046f

Logs

No response

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

1 participant