#outputFileTracingExcludes not working/recognizing what I want to exclude

3 messages · Page 1 of 1 (latest)

wide fog
#

Hi there! Am getting a warning from Vercel for our Serverless Functions Warning: Max serverless function size of 50 MB compressed or 250 MB uncompressed almost reached.

Looks like canvas is being included via PDFjs, and it's compressed size is 42.82 MB, ouch.

  1. wondering if canvas is even required?!
  2. trying to test if it's required but using outputFileTracingExcludes to exclude it from the serverless function page
  3. outputFileTracingExcludes seemingly not working - could be my paths are wrong??

Tried each of the following arrays standalone in next.config.js, none seemed to trigger:

       experimental: {
        outputFileTracingExcludes: {
            '*': [
                'node_modules/canvas/build',
            ],
            '*': [
                './node_modules/canvas/build',
            ],
            '/pages/paper/view/*': [
                './node_modules/canvas/build',
            ],
        },
    },

Any ideas here? On either ignoring, or helping with the large Serverless Function build?

median nexus
#

did you find a solution? I have the same problem

spiral tide
#

We're having the same issue in one of our nextjs apps inside a turborepo.

There's currently a related issue about packages being included without being needed here: https://github.com/vercel/next.js/issues/42641

I also found this issue just now: https://github.com/vercel/next.js/issues/54245 I'm gonna test out the legacy syntax tomorrow

GitHub

Verify canary release I verified that the issue exists in the latest Next.js canary release Provide environment information This is from a Vercel build. I've added the output below: > my-app...

GitHub

Verify canary release I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Versi...