[wp-trac] [WordPress Trac] #61224: Uncaught exception in login form

WordPress Trac noreply at wordpress.org
Wed May 15 15:35:51 UTC 2024


#61224: Uncaught exception in login form
--------------------------+-----------------------------
 Reporter:  hansmorb      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Users         |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
--------------------------+-----------------------------
 Hey,

 sorry if this is not the best technical description but our plugins E2E
 tests kept failing on the latest trunk version of WP (the releases are
 fine).

 Even when disabling all plugins and switching to the TwentyTwentyFour
 Theme the bug occurred, this is the output from Cypress:


 {{{
 TypeError: Cannot read properties of undefined (reading 'serialize')
 }}}

 and the stack trace is the following:

 {{{
 at <unknown> (http://localhost:1001/wp-admin/js/user-
 profile.min.js?ver=6.6-alpha-58156:2:6213)
 at dispatch (http://localhost:1001/wp-admin/load-
 scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,zxcvbn-async
 ,wp-polyfill,wp-hooks&ver=6.6-alpha-58156:2:40035)
 at v.handle (http://localhost:1001/wp-admin/load-
 scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,zxcvbn-async
 ,wp-polyfill,wp-hooks&ver=6.6-alpha-58156:2:38006)
 }}}

 What I noticed is, that I am changing the time using the cy.clock function
 because it was easier for me to write tests that rely on it currently not
 being the last day of the month.

 Here is the snippet of the cypress code, when I comment out the
 cy.clock(getTestDate()); function the test works.


 {{{
 describe('test booking process', () => {
   function getTestDate() {
     let dt = new Date();
     var test = new Date(dt.getTime()),
         month = test.getMonth();

     test.setDate(test.getDate() + 1);
     if (test.getMonth() !== month ) {
       dt.setDate(dt.getDate() + 1);
     }

     return dt.getTime();
   }

   beforeEach( function() {
     cy.clock(getTestDate());
     cy.visit( '/wp-login.php' );
     cy.wait( 1000 );
     cy.get( '#user_login' ).type( Cypress.env( "wpSubscriber" ) );
     cy.get( '#user_pass' ).type( Cypress.env( "wpPassword" ) );
     cy.get( '#wp-submit' ).click();
 }}}

 The test is failing shortly after clicking the #wp-submit Button on the
 login form.

 As the bug only occurred recently, and we regularly check against trunk I
 thought it might have to do something with this commit:

 [https://github.com/WordPress/WordPress/commit/39c3bec9f311fc138876632c23972309017ea157]


 The login works as expected, so I am having a hard time diagnosing the
 real underlying issue.
 I would not rule out that I am doing something wrong, so I am sorry if
 that is a non issue.

 Let me know if this is not relevant or if you need any more information
 from me.

 Thank you!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61224>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list