I am working with the elm-spa-example and currently what I wanted to achieve is actually invoke a port
function in the init method of the Login Page.
When I add the invocation to the init method of the Login page and browsed to the Login page it looks like it’s not called(For the time being I it’s just a simple console.log statement in the JavaScript side).
But When I browse to the Login page and hit refresh it looks like the invocation works perfectly.
Anybody had similar issue or do you see something obvious that I am missing here ?
Thank you
You are right testing with the latest version works for me as well in the login.
Maybe I am looking in the wrong direction and it’s about my webpack config somehow related.
I will try to test the example integrated in a phoenix project see if I can reproduce because it does not make any sense otherwise. I mean it still works for me if I refresh.
I am so sorry for wasting your time but I almost got insane and just figured out the problem
I am using a call back to load my elm app so that I know google recaptcha is loaded in advance.
window.onloadCallback = () => {
};
As it turns out the complete problem lied in the fact that somehow I had added a semicolon at the closing bracket. Deleting it fixed all weird behavior. I know I am somehow a newbie when it comes to front end staff but seriously WTF.