-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoMethodError in Devise::SessionsController#create after upgrade to 4.9 from 4.8.1 #5558
Comments
Hm interesting, I don't remember hitting anything like these in my tests but I'll try to repro with a similar setup. Any chance you can share more of the stack trace? Since that's inside Rails Active Model, it'd be nice to see where Devise is calling it for example. Also if you have any way to repro this in a sample app, that'd be great too. Thanks. |
Full stack trace:
I actually wasn't able to reproduce it on a smaller scale app with just omniauth and devise installed but if helpful the repo for my (very messy) school project where I'm getting the error is here: https://github.com/vincemilo/odin-facebook |
Thanks. Nothing jumps out at me so I might have to try and run the app locally, I'll try in the next few days, but let me know if you figure it out before. One thing I noticed is that the app is using Devise 4.8.1, not 4.9 (which is the main branch that supports Turbo), so it's nothing related to the newer changes there (that I thought could be the culprit at first). Have you hit the issue while trying to upgrade? Have you removed some of the workarounds like this and this while doing so? If you can push a branch against Devise main / 4.9 alpha, where the error actually occurs, that'd be cool too. |
Right the version on the repo is currently running 4.8.1 for it to function
properly but if you upgrade it to 4.9 you will get the error which is where
I'm currently stuck.
Not sure what you mean by workarounds?
…On Thu, Feb 16, 2023, 5:35 AM Carlos Antonio da Silva < ***@***.***> wrote:
Thanks. Nothing jumps out at me so I might have to try and run the app
locally, I'll try in the next few days, but let me know if you figure it
out before.
One thing I noticed is that the app is using Devise 4.8.1, not 4.9 (which
is the main branch that supports Turbo), so it's nothing related to the
newer changes there (that I thought could be the culprit at first).
—
Reply to this email directly, view it on GitHub
<#5558 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL3UN4CAY5NVDTU5YKPJALWXYNKZANCNFSM6AAAAAAU5MXBWI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sorry, I updated the comment right after sending it with this bit:
Those additional pieces of code related to supporting Turbo are no longer necessary on the main Devise branch. I'll try to take a look at the app in the next few days and see if I can learn something. |
@vincemilo I got your app working with Devise main and sent you a PR with the diff so you can take a look there: vincemilo/odin-facebook#1. Everything seems to be working with those changes as I expected, but please let me know if you run into any issues. |
@carlosantoniodasilva thanks for this example, unfortunately for me, it doesn't work for sessions (specifically the login). It just re-renders, any advice on what should be looking for? Thanks in advance. |
@ricvillagrana when you say it just re-renders, you mean it just show the form again without the error flash message? This could be because it's not actually re-calling the controller to render the session form again, in my previous tests it was because the failure app was customized to redirect instead, which loses the flash message context, or maybe because the error status code wasn't configured. If you've upgraded your app and had custom failure app / parent controller set for Turbo specifically, those have to be removed. Also make sure you're using responders 3.1.0+ and have customized the error responses as shown in the changelog/wiki and in the sample upgrade above. Let me know if none of those work. |
This did the trick, thanks so much! I guess |
@vincemilo awesome!
That is not an "official" way to integrate / make it work, but it was widely used as a custom implementation while Devise didn't have proper integration with Turbo built-in. Now that it has, that custom code can be safely removed. |
Environment
Current behavior
When trying to login with a current user or create a new user:
undefined method empty?' for #<User id: 9, email: "xxxx", created_at: "2023-02-15 21:53:06.157323000 +0000", updated_at: "2023-02-15 21:53:06.157323000 +0000", notice_seen: nil, provider: nil, uid: nil, name: "xxxx", image: nil>
Extracted source (around line #458):
activemodel (7.0.3.1) lib/active_model/attribute_methods.rb:458:in method_missing'
...
Expected behavior
Did not have this issue before in version 4.8.1 and if I rollback to earlier version it works again.
The text was updated successfully, but these errors were encountered: