vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.09k stars 27.01k forks source link

Arbitrary 30kb limit on third party api calls #42333

Closed LankieB closed 2 years ago

LankieB commented 2 years ago

Verify canary release

Provide environment information

Macbook, React 18, Node 18

What browser are you using? (if relevant)

Firefox and Chrome

How are you deploying your application? (if relevant)

Still developing on localhost

Describe the Bug

I am migrating my Next 12 project to Next 13 but is having issues with supabase in the app directory. It works well in the pages/api but shows a persistent error in app. See below:

warn ./node_modules/cross-fetch/node_modules/node-fetch/lib/index.js Module not found: Can't resolve 'encoding' in '/Users/xx/../node_modules/cross-fetch/node_modules/node-fetch/lib

After adding encoding, the first error disappeared. Add encoding to your dev dependencies

After tracing the bug, I realised that if the data is less than 30kb, it works fine. But if not, the error message is:

Unhandled Runtime Error TypeError: error in body stream

This has per

Expected Behavior

As with Next 12, the 30kb limit should not be an issue. I ran my code (next12 and next13) side by side and the next12 version had no issue

Link to reproduction

n/a

To Reproduce

table sample data. once it hits the 30kb size (I tested this with Postman), it freezes

error
LankieB commented 2 years ago

the latest error from Node when I tried to reproduce the bug is below:

(node:35080) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 client/_error listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit (Use node --trace-warnings ... to show where the warning was created) event - compiled client and server successfully in 4.8s (1757 modules)

awareness481 commented 2 years ago

This should be fixed in https://github.com/vercel/next.js/releases/tag/v13.0.1 . Did you make sure to upgrade? If you upgraded and still get the error you should post a reproduction.

LankieB commented 2 years ago

Thanks so much. I'll upgrade ASAP. This made my day

github-actions[bot] commented 1 year ago

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.