I have read many posts around functions and package json’s, node_module installs etc. However after trying every suggestion, nothing works.
I am running a lambda function with apollo-server-lambda, graphql, and typeorm.
Every function works fine in “netlify dev” and calls are made etc. No issues.
However, once I deploy to netlify it seems to remove the MySQL package that typeorm is reliant on as I am connecting to a MySQL database. (I have tried the serverless-typeorm and serverless-mysql packages too).
My file structure is:
Functions -> - graphql.js ->bundle -> built files from Server that graphql function points to (tried from netlify build and build and commit for netlify). Server -> packageJson Node_Modules server.js - (This requires typeorm, MySQL, and other packages, other packages seem to work?) Src(frontend) PackageJson (I have tried including all deps here without the server packagejson too) Node_Modules
I have deployed to App ID: c8917f89-5771-44ae-88f0-c1ebda658dbb
on a branch deploy on branch newDb.
I will be willing to give access to the git repo that is private to netlify support team members.
I have tried to build functions with netlify-lambda, tried not building at all, etc.
As mentioned before it works in dev and netlify dev