sync main with release after debugging email verification #371
Reference in New Issue
Block a user
Delete Branch "release"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've been pushing straight to my release branch a lot to debug in prod :( so this is a merge back to
mainto get it synced up again now that I've got something working.I've been having trouble with a bug with email verification. I traced it back to when I upgraded to Redwood v0.32.
I tried a bunch of things, but it came down to believing the errors I was getting from my netlify identity-signup function (formatted a little to make it easier to read).
The issue is that it's not able to find
'graphql-tag'deep in a redwood dependencies which eventually leads up to myidentity-signupfunction. My work around is basically to makegraphql-tagan explicit dependency even though I'm not using directly to make sure it is included.Because I wanted to make sure this worked with the lastest redwood as well I've upgraded to v0.34 as well here.
I'm pretty sure that this is a Redwood bug, I think that's safe to say since
graphql-tagis a redwood dependency, not mine?? (edit, it's not, it's from a change netlify made)CC @thedavidprice @dthyresson
@@ -9,3 +9,3 @@}}}Listing as dependency for the API.
@@ -2,6 +2,7 @@ import { createUserInsecure } from 'src/services/users/users.js'import { db } from 'src/lib/db'import { sentryWrapper } from 'src/lib/sentry'import { enforceAlphaNumeric, generateUniqueString } from 'src/services/helpers'import 'graphql-tag'and explicitly requiring this dependency for my signup function
@@ -2,6 +2,7 @@ import { createUserInsecure } from 'src/services/users/users.js'import { db } from 'src/lib/db'import { sentryWrapper } from 'src/lib/sentry'import { enforceAlphaNumeric, generateUniqueString } from 'src/services/helpers'import 'graphql-tag'From: https://community.redwoodjs.com/t/redwood-v0-32/2118/7
Ah - you said the magic word trifecta of Netlify + Functions + Dependency and I wonder if you encountered this: https://www.netlify.com/blog/2021/04/02/modern-faster-netlify-functions/
Perhaps the way Netlify is bundling now wasn't finding that dependency?
And v.0.32 was released on May 14 so ... "week of May 17" does coincide.
Thus
make graphql-tag and explicit dependencyfixing the issue fits.Thusmake graphql-tag and explicit dependencyfixing the issue fits.@Irev-Dev I looked through your code and the upgrade and modifications look correct. One thing to note is that we had some major changes to the way dependencies within Redwood packages are handled (and where they live). If you run into problems with other dependencies not working, you might try recreating your yarn.lock — this could yield mixed results but is worth a try.
I do not see the need to add graphql-tag to api, as it will be hoisted from the /core package.
I'm not surprised you had to end up importing the dependency directly into the function (which you can do without adding it to api package). As DT's comments above indicate, we do not control the mechanism whereby hosting providers will package+build individual functions for deployment to AWS Lambdas, etc. Bummer indeed they didn't communicate this in the first place (I missed it as well) — definitely painful to debug.
Thanks @thedavidprice,
Yup that makes sense that I shouldn't need to add the package. I guess if redwood eventually drops
graphql-tagas a dependancy (unlikely 😂 ), that will break my build, but that's a good thing since it will be a nice prod that I can remove that import.I'll regenerate my yarn lock soon too.
Doubtful we'll ever drop it. More likely we upgrade the version in core, which could then be out of sync with the one you added.