I just realized that I had the connection limit missing on the db url env var. Although from the docs it appears to be recommended and not required. I am trying to redeploy with that change to see if that fixes it.
This is my netlify.toml, I haven’t changed it:
[build]
command = "yarn rw deploy netlify"
publish = "web/dist"
functions = "api/dist/functions"
[dev]
# To use [Netlify Dev](https://www.netlify.com/products/dev/),
# install netlify-cli from https://docs.netlify.com/cli/get-started/#installation
# and then use netlify link https://docs.netlify.com/cli/get-started/#link-and-unlink-sites
# to connect your local project to a site already on Netlify
# then run netlify dev and our app will be accessible on the port specified below
framework = "redwoodjs"
# Set targetPort to the [web] side port as defined in redwood.toml
targetPort = 8910
# Point your browser to this port to access your RedwoodJS app
port = 8888
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
binaryTargets = "native"
}
model User {
id Int @id @default(autoincrement())
name String?
email String @unique
hashedPassword String
salt String
resetToken String?
resetTokenExpiresAt DateTime?
}
model Post {
id String @id @default(uuid())
title String
body String
createdAt DateTime @default(now())
}
model Contact {
id String @id @default(uuid())
name String
email String
message String
createdAt DateTime @default(now())
}
One thing that I am using differently is that I am using the redwoodjs record lib, maybe that requires an extra step in the netlify build? or there is an error there?
11:31:37 AM: ────────────────────────────────────────────────────────────────
11:31:37 AM: 2. Functions bundling
11:31:37 AM: ────────────────────────────────────────────────────────────────
11:31:37 AM:
11:31:37 AM: Packaging Functions from api/dist/functions directory:
11:31:37 AM: - auth.js
11:31:37 AM: - graphql.js
11:31:37 AM:
11:32:05 AM:
11:32:05 AM: (Functions bundling completed in 28.2s)
11:32:05 AM:
11:32:05 AM: ────────────────────────────────────────────────────────────────
11:32:05 AM: 3. Deploy site
11:32:05 AM: ────────────────────────────────────────────────────────────────
11:32:05 AM:
11:32:05 AM: Starting to deploy site from 'web/dist'
11:32:10 AM: Creating deploy tree
11:32:10 AM: Creating deploy upload records
11:32:10 AM: 1 new files to upload
11:32:10 AM: 1 new functions to upload
11:32:16 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:32:19 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:32:22 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:32:24 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:32:27 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:32:30 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:32:36 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:32:43 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:32:54 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:33:10 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:33:37 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:33:53 AM: Request must be smaller than 69905067 bytes for the CreateFunction operation
11:33:53 AM: Failed to upload file: graphql
11:33:53 AM: Site deploy was successfully initiated
11:33:53 AM:
11:33:53 AM: (Deploy site completed in 1m 47.8s)
11:33:53 AM:
11:33:53 AM: ────────────────────────────────────────────────────────────────
11:33:53 AM: Netlify Build Complete
11:33:53 AM: ────────────────────────────────────────────────────────────────
11:33:53 AM:
11:33:53 AM: (Netlify Build completed in 3m 34.1s)
11:33:53 AM: Execution cancelled
11:33:53 AM: Error running command: Command was cancelled
11:33:53 AM: Failing build: Failed to build site
11:33:53 AM: Finished processing build request in 5m40.584157527s
Unless RR itself is causing something to balloon in size…can you try running yarn rw build locally and see if that completes? I don’t think that prepares the built files in the same way that Netlify does, they have an extra step called zip-it-and-ship-it that prepares the files for AWS Lambda: https://github.com/netlify/zip-it-and-ship-it There may be a way to run that locally in Redwood…I’m waiting to hear back from some Redwood folks if that’s the case.
I confirmed that our build process with yarn rw build doesn’t use the zip-it-and-ship-it in any way. But, we could install and run it manually: https://github.com/netlify/zip-it-and-ship-it
It sounds like srcFolders just needs to be the api/src/functions folder, after going through yarn rw build. But that process might just blow up with the same error.
Can you find the zipped up files somewhere? And if so, how big are they? I’m thinking we could unzip and poke through them and see if there’s some weird circular dependency that’s taking up way too much disk space.
I checked, not sure if it is normal but inside the zipped balls as they call them, the node modules folder is really big and when looking into that, they all appear to be normal except for prisma that is 220mb
The bulk of it comes from the sdk and the engines folder:
Hmm I’ve got the SDK in there as a dependency of RR, but maybe it can be a devDependency: I’m pretty sure it’s only used on yarn rw record init. But then the datamodel.json file would have to get moved somewhere that can be checked in so that it’s available at deploy time and won’t need to be created by Netlify. Maybe it could go in api/src/models along with everything else? Or in api/src/db along with the other database stuff, but I don’t know if Prisma will freak out if there’s a file in there that it doesn’t manage itself.
So maybe just a change to:
and
And that’ll bring the bundle size back under control?
I can try that out see if it reduces the zipballs size locally. I like it going in api/src/models. I’ll keep you posted and if it works I’ll create a PR.