Skip to content
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

Postcode field not loading when we try to open store on new device. #72

Open
kevalkavathiya opened this issue Feb 16, 2023 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kevalkavathiya
Copy link

image

I used this module's latest version and I am getting issues when trying to open the checkout page very first time on the new device I think it is happening due to below errors.

image
image

After the refresh, page errors have not been generated and it is working again. If any idea about this could you please help us to resolve this?

@tausif22
Copy link

tausif22 commented Feb 16, 2023

@kevalkavathiya

I have facing same issue like this.

@Paulsky
Copy link

Paulsky commented Apr 14, 2023

You could try this patch mentioned here: #77 (comment) . But not sure if you will experience side effects mentioned here: #78 (comment)

@kevalkavathiya
Copy link
Author

I have added the changes from #78 pull request and its working for me.

@Paulsky
Copy link

Paulsky commented Aug 11, 2023

@kevalkavathiya great to hear! Could you please re-open this issue and keep it open...? Because it's still an issue which is not yet permanently fixed I guess....

What do you think @JerrySmidt ?

@JerrySmidt
Copy link
Contributor

Still unresolved, see #78 (comment)

@marcoveeneman
Copy link

I have seen this issue happening as well, not knowing exactly what the root cause is, and I'm afraid some customers can see the same behaviour and don't know what to do, possibly causing a cart to be abandoned. The strange thing is it is not always happening.

Setup:

  • Magento 2.4.5-p4
  • Postcode-nl 3.1.11

I managed to get the following console log in chrome (note there are some duplicate messages):

jquery.js:4050 jQuery.Deferred exception: Cannot read properties of undefined (reading 'show_hide_address_fields') TypeError: Cannot read properties of undefined (reading 'show_hide_address_fields')
    at UiClass.initialize (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/Flekto_Postcode/js/form/element/house-number-select.js:18:31)
    at UiClass.initialize (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/mage/utils/wrapper.js:109:34)
    at new UiClass (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/Magento_Ui/js/lib/core/class.js:49:32)
    at initComponent (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/Magento_Ui/js/core/renderer/layout.js:137:25)
    at fire (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3500:50)
    at fireWith (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3630:29)
    at mightThrow (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3825:80)
    at process (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3834:49)
    at https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3864:37
    at mightThrow (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3766:60) undefined
jQuery.Deferred.exceptionHook @ jquery.js:4050
jquery.js:4050 jQuery.Deferred exception: Cannot read properties of undefined (reading 'show_hide_address_fields') TypeError: Cannot read properties of undefined (reading 'show_hide_address_fields')
    at UiClass.initialize (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/Flekto_Postcode/js/form/element/house-number-select.js:18:31)
    at UiClass.initialize (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/mage/utils/wrapper.js:109:34)
    at new UiClass (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/Magento_Ui/js/lib/core/class.js:49:32)
    at initComponent (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/Magento_Ui/js/core/renderer/layout.js:137:25)
    at fire (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3500:50)
    at fireWith (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3630:29)
    at mightThrow (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3825:80)
    at process (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3834:49)
    at https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3864:37
    at mightThrow (https://www.example.com/static/version1234567890/frontend/Vendor/theme-example/nl_NL/jquery.js:3766:60) undefined
jQuery.Deferred.exceptionHook @ jquery.js:4050
address-autofill-nl.js:171 Uncaught TypeError: Cannot read properties of undefined (reading 'setOptions')
    at UiClass.resetHouseNumberSelect (address-autofill-nl.js:171:42)
    at UiClass.onInputHouseNumber (address-autofill-nl.js:97:22)
    at setNested (objects.js:44:25)
    at Object.nested (objects.js:118:20)
    at UiClass.set (element.js:305:19)
    at updateValue (links.js:80:19)
    at setLink (links.js:209:17)
    at links.js:236:25
    at Registry._resolveRequest (registry.js:416:30)
    at Array.forEach (<anonymous>)
objects.js:116 Uncaught TypeError: path.split is not a function
    at Object.nested (objects.js:116:32)
    at UiClass.get (element.js:286:26)
    at UiClass.set (element.js:298:29)
    at updateValue (links.js:80:19)
    at setLink (links.js:209:17)
    at links.js:236:25
    at Registry._resolveRequest (registry.js:416:30)
    at Array.forEach (<anonymous>)
    at Registry._updateRequests (registry.js:398:18)
    at later (underscore.js:1153:47)
objects.js:116 Uncaught TypeError: path.split is not a function
    at Object.nested (objects.js:116:32)
    at UiClass.get (element.js:286:26)
    at UiClass.set (element.js:298:29)
    at updateValue (links.js:80:19)
    at setLink (links.js:209:17)
    at links.js:236:25
    at Registry._resolveRequest (registry.js:416:30)
    at Array.forEach (<anonymous>)
    at Registry._updateRequests (registry.js:398:18)
    at later (underscore.js:1153:47)
objects.js:116 Uncaught TypeError: path.split is not a function
    at Object.nested (objects.js:116:32)
    at UiClass.get (element.js:286:26)
    at UiClass.set (element.js:298:29)
    at updateValue (links.js:80:19)
    at setLink (links.js:209:17)
    at links.js:236:25
    at Registry._resolveRequest (registry.js:416:30)
    at Array.forEach (<anonymous>)
    at Registry._updateRequests (registry.js:398:18)
    at later (underscore.js:1153:47)
objects.js:116 Uncaught TypeError: path.split is not a function
    at Object.nested (objects.js:116:32)
    at UiClass.get (element.js:286:26)
    at UiClass.set (element.js:298:29)
    at updateValue (links.js:80:19)
    at setLink (links.js:209:17)
    at links.js:236:25
    at Registry._resolveRequest (registry.js:416:30)
    at Array.forEach (<anonymous>)
    at Registry._updateRequests (registry.js:398:18)
    at later (underscore.js:1153:47)
objects.js:116 Uncaught TypeError: path.split is not a function
    at Object.nested (objects.js:116:32)
    at UiClass.get (element.js:286:26)
    at UiClass.set (element.js:298:29)
    at updateValue (links.js:80:19)
    at setLink (links.js:209:17)
    at links.js:236:25
    at Registry._resolveRequest (registry.js:416:30)
    at Array.forEach (<anonymous>)
    at Registry._updateRequests (registry.js:398:18)
    at later (underscore.js:1153:47)
objects.js:116 Uncaught TypeError: path.split is not a function
    at Object.nested (objects.js:116:32)
    at UiClass.get (element.js:286:26)
    at UiClass.set (element.js:298:29)
    at updateValue (links.js:80:19)
    at setLink (links.js:209:17)
    at links.js:236:25
    at Registry._resolveRequest (registry.js:416:30)
    at Array.forEach (<anonymous>)
    at Registry._updateRequests (registry.js:398:18)
    at later (underscore.js:1153:47)

Somehow some properties are undefined, as also mentioned in several other issues: #77, #66.

In above log there seem to be two issues:

  1. in house-number-select.js, when trying to read 'show_hide_address_fields', this.settings is undefined causing an exception.
  2. in address-autofill-nl.js, this.childHouseNumberSelect() in resetHouseNumberSelect returns undefined, causing setOptions() to fail.

I have not found a reliable way to reproduce this yet.

@JerrySmidt
Copy link
Contributor

JerrySmidt commented Sep 5, 2023

I've added a pull request that may resolve this issue. If anyone here could verify if this PR works for you, please let me know.
Should be fixed in 3.2.0.

@JerrySmidt JerrySmidt added help wanted Extra attention is needed bug Something isn't working labels Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants