lundi 15 avril 2019

Ghost URL loaded in Ember

I have a weird behaviour. We are working with Ember on Git for a while now, but in this new project, I'm having for the first time an issue following the bellow steps:

  1. Add a new .svg image and delete the old .png
  2. Then I change all references to the .png with the .svg image name
  3. Check that is working. It does
  4. git add .
  5. git commit -m "my message"
  6. git pull [branch]
  7. git push [branch]
  8. Go back to the browser and images are broken
  9. Look at the generated code and src url is pointing to the old .png image

We find

<img class="logo" src="./assets/images/logo.png" alt="logo">

instead of:

<img class="logo" src="./assets/images/logo.svg" alt="logo">

  1. Ask my partner to get my code in the branch and check if he's getting the same issue. He doesn't, he sees the new .svg image.

  2. I deleted the local branch and bring it back again. The issue is gone.

  3. I do some changes and pull again and then the issue comes back.

I have the following code in the template.hbs

<img class="logo" src="" alt="logo">

and this in the component:

logo: computed('logo', function() {
        return htmlSafe('./assets/images/' + ((config.APP.logo) ? config.APP.logo : 'logo.svg'));
    })

This is calling to an environment condition that determines the logo that have to be loaded.

Did this happened to any of you? Do you have any idea of how to prevent this happen?




Aucun commentaire:

Enregistrer un commentaire