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.
Basically I am following the Netlify tutorial on the Docs on Redwood and I follow steps
Like using railway for postgres
then yarn rw setup deploy netlify
after making edits in netlify.toml file
[build]
command = "yarn rw deploy netlify"
publish = "web/dist"
# [functions]
functions = "api/dist/functions"
# directory = "api/dist/functions"
# http://localhost:8910/.netlify/functions/graphql
# Flags "package-1" as an external node module for all functions.
# [functions.functions]
# external_node_modules = [
# "api/dist/",
# "lib",
# "directives",
# "services",
# "graphql"
# ]
# Includes all Markdown files inside the "files/" directory.
# included_files = ["files/*.md"]
# included_files = ["api/dist/*.js"]
# included_files = ["api/dist/directives/*"]
# included_files = ["api/dist/graphql/*"]
# included_files = ["api/dist/lib/*"]
# included_files = ["api/dist/services/*"]
# [functions]
# directory = "api/dist/"
# [functions.directory2]
# directory2 = "api/dist/lib"
[dev]
# yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up
# 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 = "/200.html"
status = 200
However my netlify serverless functions gives we error accessible at this URL
What I figured out is the serverless function cannot located the ‘…\lib\auth’ library even the build file in dist does have that library and code available. What this means is that all my graphQL queries are failing all forms all to submit data etc
I have been looking for answer all day sunday came cross this old post it was the most similar. The logs on netlify serverless function are pretty much the same
Aug 9, 08:34:31 PM: 342bc5ac Duration: 2322.17 ms Memory Usage: 91 MB Aug 9, 08:34:31 PM: Unknown application error occurred
Runtime.ImportModuleError
Aug 9, 08:34:32 PM: 2022-08-10T00:34:32.218Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '..\\..\\lib\\auth'\nRequire stack:\n- /var/task/api/dist/directives/requireAuth/requireAuth.js\n- /var/task/api/dist/functions/graphql.js\n- /var/task/graphql.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module '..\\..\\lib\\auth'","Require stack:","- /var/task/api/dist/directives/requireAuth/requireAuth.js","- /var/task/api/dist/functions/graphql.js","- /var/task/graphql.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:726:17)"," at async Object.module.exports.load (file:///var/runtime/index.mjs:741:21)"," at async file:///var/runtime/index.mjs:781:15"," at async file:///var/runtime/index.mjs:4:1"]}
Aug 9, 08:34:32 PM: 5245799d Duration: 2251.47 ms Memory Usage: 92 MB Aug 9, 08:34:32 PM: Unknown application error occurred
Runtime.ImportModuleError
Aug 9, 08:34:33 PM: 2022-08-10T00:34:33.375Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '..\\..\\lib\\auth'\nRequire stack:\n- /var/task/api/dist/directives/requireAuth/requireAuth.js\n- /var/task/api/dist/functions/graphql.js\n- /var/task/graphql.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module '..\\..\\lib\\auth'","Require stack:","- /var/task/api/dist/directives/requireAuth/requireAuth.js","- /var/task/api/dist/functions/graphql.js","- /var/task/graphql.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:726:17)"," at async Object.module.exports.load (file:///var/runtime/index.mjs:741:21)"," at async file:///var/runtime/index.mjs:781:15"," at async file:///var/runtime/index.mjs:4:1"]}
Aug 9, 08:34:33 PM: f7ff3246 Duration: 2368.25 ms Memory Usage: 97 MB Aug 9, 08:34:33 PM: Unknown application error occurred
Runtime.ImportModuleError
Yes so the included files is supposed to import those files outside of directory and I tried that directly for each folder and files contained in each folder but this did not work or remove the error.
What do you mean by force do you have a specific command line you are referencing?