Redwood Deployment Serverless Function Error

here’s the .env file dump for the database to be public


DATABASE_URL=postgres://postgres:uUGMmCtPeu7qQsVC@db.fxmqshrlefcjjatkgywq.supabase.co:5432/postgres?pgbouncer=true&connection_limit=1

# Sets an app-specific secret used to sign and verify your own app's webhooks.

# For example if you schedule a cron job with a signed payload that later will

# then invoke your api-side webhook function you will use this secret to sign and the verify.

# Important: Please change this default to a strong password or other secret

# WEBHOOK_SECRET=THIS_IS_NOT_SECRET_PLEASE_CHANGE

# Used to encrypt/decrypt session cookies. Change this value and re-deploy to log out all users of your app at once.

SESSION_SECRET=fu4DTS4rHvsLtYs9aXVfaXTXJPWmYW77bP2qbEC9ysDWfN2Xhb98RNMnS6gsZHRf

As @hrishikesh pointed out previously

the functions are in api/src/functions, however you are specifying api/dist/functions for Netlify to build from. The lib directory, along with other things, is in api/src but the import here is looking in api/dist.

This is suggesting to me that RedwoodJS is pre-building/copying the functions from api/src/functions to api/dist/functions, however it is not including the modules in lib, ergo they are missing when Netlify tries to build the functions.

Are the functions required for the deployed site or are they only running in a server mode while building?

Redwood is building the functions to dist along with the imports. However, it isn’t bundling them.

To get Netlify CLI to build the functions I added this to the netlify.toml

[functions]
  included_files = ["api/dist/directives/**","api/dist/graphql/**","api/dist/lib/**","api/dist/services/**",]

as per

However, this did result in the following error

⠦ (2/3) Uploading graphql... ›   Warning: JSONHTTPError:  500
 ›   Warning:
{
  "name": "JSONHTTPError",
  "status": 500,
  "json": {
    "status": 500,
    "error": "Internal Server Error"
  }
}

 ›   JSONHTTPError: Internal Server Error

Hey @Gresliebear ! Since you mentioned that this is an issue with RedwoodJS earlier in this thread, we’re going to mark this as answered. We’ll leave the thread open so you can continue to discuss, though!