Planetscale Error: 431 Request Header Fields Too Large

I am trying to do a simple GET call (select * from …).
I get the following error: “GET
[HTTP/1.1 431 Request Header Fields Too Large 1323ms]”.
I have the function select.tsx function file in the node_modules/@netlify/functions folder.
The fetch request that I’m using is:

            '/.netlify/functions/select', {
            method: 'GET',
            headers: { 	
                "Content-Type": "application/json",
                "Accept": "application/json"
            .then((res) => {
                //console.log("No GET error!")
            .catch((err) => console.log(err))

I have tried using:
‘.netlify/functions/select’, and
The function looks like this:

const handler: Handler = withPlanetscale(async (event, context) => {
  const {
    planetscale: { connection },
  } = context;

  console.log('MADE IT INSIDE!')

  const { body } = event;

  return connection.execute('select * from Todo')
    .then((res) => {
      return {
        statusCode: 201,
        body: JSON.stringify(res),
    .catch((err) => ({
        statusCode: 400,
        body: JSON.stringify(err),

export { handler };

We’ll ask the relevant team and let you know.


Coul you try this in an incognito mode to be sure the cookie and cache situation is correct? Also, you would have to add your Netlify Functions to the normal netlify folder, not inside of node_modules.