You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Locally everything worked great, just like our prior existing products that had used this amazing library. Production in our new AWS environment threw the error in the title or similar depending on how we setup the schemas.
Finally after over a week of trying dozens of various alternative setups (all worked locally, failed in cloud environment - aws lambdas) I read the source code. I found the checks are done using
if (!tc \|\| tc.constructor.name !== 'ObjectTypeComposer') {
The problem is minified code without source-maps will change the constructor name. At least that's my working theory.
This method of checking the type of tc is prone to issues with minification. I think the source maps will fix it, but i'm not 100%. Worst case scenario I'll disable minification for now.
I hope this helps someone else struggling with this.
Once we get this project launched I may open a PR with a fix for this, but for now wanted to get it out there.
The text was updated successfully, but these errors were encountered:
Update. I managed to get this thing humming along in production. The issue was the uglification/minification that serverless-bundle does with serverless-webpack under the covers.
I attempted turning off minification, turning on source maps and various other combinations. None of them worked, so finally I moved several libraries to externals and it worked. Here is an excerpt from my serverless.yml in case anyone stumbles across this and is in the same pickle.
This one was obscure and hard to find.
Locally everything worked great, just like our prior existing products that had used this amazing library. Production in our new AWS environment threw the error in the title or similar depending on how we setup the schemas.
Finally after over a week of trying dozens of various alternative setups (all worked locally, failed in cloud environment - aws lambdas) I read the source code. I found the checks are done using
The problem is minified code without source-maps will change the constructor name. At least that's my working theory.
This method of checking the type of tc is prone to issues with minification. I think the source maps will fix it, but i'm not 100%. Worst case scenario I'll disable minification for now.
I hope this helps someone else struggling with this.
Once we get this project launched I may open a PR with a fix for this, but for now wanted to get it out there.
The text was updated successfully, but these errors were encountered: