Can not read properties of null (reading 'startsWith')

Wappler Version : 6.8.0 - with updated extensions released yesterday 20 Sep 24
Operating System : MacOS 15.0
Server Model: NodeJS
Database Type: PostgrSQL
Hosting Type: Docker local

Expected behavior

Clicking on a button to direct to another page, should not dispaly an error in the Console.

Actual behavior

Clicking on a button to direct to another page using the dmx-on:click="browser1.goto('/dashboard' ,true)

Gives this error in the browser console. Although I get directed to the correct page.

4link.js:117 Uncaught TypeError: Cannot read properties of null (reading 'startsWith')
at s._stateHandler (link.js:117:1)
at History.pushState (appConnect.js:11:1)
at s.goto (browser.js:90:1)
at Object.keys.forEach.data. (BaseComponent.js:470:1)
at parser.js:727:1
at parser.js:469:1
at dmx.parse (parser.js:404:1)
at HTMLButtonElement. (on.js:14:1)
at HTMLButtonElement.a (events.js:280:1)
at HTMLButtonElement.dispatch (jquery-3.5.1.slim.min.js:2:42868)
_stateHandler @ link.js:117
(anonymous) @ appConnect.js:11
goto @ browser.js:90
Object.keys.forEach.data. @ BaseComponent.js:470
(anonymous) @ parser.js:727
(anonymous) @ parser.js:469
dmx.parse @ parser.js:404
(anonymous) @ on.js:14
a @ events.js:280
dispatch @ jquery-3.5.1.slim.min.js:2
v.handle @ jquery-3.5.1.slim.min.js:2Understand this error
4link.js:117 Uncaught TypeError: Cannot read properties of null (reading 'startsWith')
at s._stateHandler (link.js:117:1)
at s.goto (browser.js:92:1)
at Object.keys.forEach.data. (BaseComponent.js:470:1)
at parser.js:727:1
at parser.js:469:1
at dmx.parse (parser.js:404:1)
at HTMLButtonElement. (on.js:14:1)
at HTMLButtonElement.a (events.js:280:1)
at HTMLButtonElement.dispatch (jquery-3.5.1.slim.min.js:2:42868)
at v.handle (jquery-3.5.1.slim.min.js:2:40852)

How to reproduce

Create a button on dynamic event on click - browser - provide a url to another page.

Save the page.
Click on the button and see the error on the browser console.

Please note, I noticed this error following the extensions update released yesterday.

Do you have a link (<a> tag) on the page without a href?

Hi @patrick

No I don't.

I have a dynamic event on a button that when on click should take to another page and it does as well. However I get above error on the browser console.

Here is the code snippet:

 <button id="btn2" class="btn" dmx-on:click="browser1.goto('/scope/manage_scope/',true)"><i class="fa-regular fa-folder-open"></i>&nbsp;Quals Management</button>

I think that I found the place of the error but that should only happen on a link without a href. You're sure that you don't have some anchor node on the page?

Here an update for the issue:
dmxRouting.zip (10.0 KB)

1 Like

Thanks @patrick

It solved the issue. I don't get the error on the browser console after using the dmxRouting files you shared above. It will be great to have these included in the next release/update.

Cheers

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.