Live view error in old safari

OSX: 10.13 (17A365)
Safari: 11.0 (13604.1.38.1.6)
LiveView: 0.4.1

On older versions of Safari, I encounter some errors with my liveview.

  1. [Error] TypeError: n.entries is not a function. (In ‘n.entries()’, ‘n.entries’ is undefined)

StackTrace:

O (phoenix_live_view.js:375)
	value (phoenix_live_view.js:1438)
	value (phoenix_live_view.js:1481:135)
	value (phoenix_live_view.js:576)
	(anonymous function) (phoenix_live_view.js:791)
	(anonymous function) (phoenix_live_view.js:828)
	click
	trigger (jquery.js:8510)
	(anonymous function) (jquery.js:8549)
	each (jquery.js:367)
	listenToBoundsChange (search_map.js:161)
	j (js:194:300)
	trigger (js:191:159)
	b (map.js:31:139)

My code at search_map.js:161 is $('#myForm button[type=submit]').click();

I do not receive any data from the server (which I was expected after my form submit)

[Error] WebSocket connection to 'ws://localhost:4000/phoenix/live_reload/socket/websocket?vsn=2.0.0' failed: WebSocket is closed due to suspension.
[Error] WebSocket connection to 'ws://localhost:4000/live/websocket?vsn=2.0.0' failed: WebSocket is closed due to suspension.

Sometimes I get both (1) and (2). These two are on the same liveview.

On another liveview, I get the following error every time I change something in my form (inputs, radio buttons, checkboxes)

[Error] TypeError: new FormData(n.form).getAll is not a function. (In 'new FormData(n.form).getAll(n.name)', 'new FormData(n.form).getAll' is undefined)
	(anonymous function) (phoenix_live_view.js:803)
	(anonymous function) (phoenix_live_view.js:828)

Do these errors ring a bell for you guys? Can you please point a direction to figure it out what I’m doing wrong on my side?

Every thing works perfect on Chrome, Firefox, Opera

By the way, great framework. You’ve done a very good job. Thanks.

https://caniuse.com/#feat=mdn-api_formdata_entries
https://caniuse.com/#feat=mdn-api_formdata_getall

Those suggests your errors 1 and 3 should not be happening in safari 11.

1 Like

In the developer console in the browser when you click do you see the submit happen in the network tab, are there any js errors as you using js to click and if there are errors nothing is going to work? Are you getting a success 200? If your not even sending, is the button in a form? As submit requires a form and matching open and closes for all dom elements. Alternatively create a function on the click handler, event.preventDefault() to stop the default submit action and ajax post it. Also try and target the form element in the console and try and call .submit() directly on the form and .click on the button, you can call the js fn directly from the console.

Best thing you can do is check the developer console as your posting from the client side so debug there first

Also is the button inside the form, does it work if you click it in the ui?