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

Injected script not being appropriately fingerprinted #32

Closed
agrobbin opened this issue Aug 1, 2016 · 2 comments
Closed

Injected script not being appropriately fingerprinted #32

agrobbin opened this issue Aug 1, 2016 · 2 comments

Comments

@agrobbin
Copy link

agrobbin commented Aug 1, 2016

I'm not sure if this belongs in this repository or ember-cli, so I thought I'd start here.

I'm trying to upgrade my Ember app to 2.7, which includes the deprecation of baseURL in favor of rootURL, and am having issues with ember-cli-live-reload.js not being correctly loaded anymore. I believe I've narrowed it down to the fact that this addon's content-for "head" is generating a script HTML tag that is not appropriately fingerprinted as part of my development workflow. I follow the ember-cli-deploy-lightning-pack deployment process, including setting a fingerprint.prepend config option so that I can easily run the Ember app via my Rails API backend.

What I end up seeing locally in my compiled index.html is:

<!DOCTYPE html>
<html>
  <head>
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic|Roboto+Slab:400,700" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Concierge</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">


<meta name="concierge/config/environment" content="..." />
<script src="/ember-cli-live-reload.js" type="text/javascript"></script>

    <link rel="stylesheet" href="http://foo.example.com:3701/assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css">
    <link rel="stylesheet" href="http://foo.example.com:3701/assets/concierge-68238d05d8c846b15a26246906dbfff1.css">


  </head>
  <body>


    <script src="http://foo.example.com:3701/assets/vendor-634beea64fb44c0889763a1850d9f892.js"></script>
    <script src="http://foo.example.com:3701/assets/concierge-0423df8642ac8af31ada605ab0bd16d9.js"></script>


  </body>
</html>

You'll notice that all of the script/link tags have http://foo.example.com:3701 prepended to the asset path, but the ember-cli-live-reload.js script tag does not.

I'm pretty sure this is because the data returned from contentFor is not being passed through the broccoli-asset-rev fingerprinting process, but don't know enough about it to figure out why.

Let me know if there is anything else I can do to help figure out how to resolve this, or if I'm just doing something stupid!

@maxscott
Copy link

I hit this recently on an app loaded with a custom rootURL, and was able to leverage that to get the correct "fingerprinting" on the ember-cli-live-reload. But I'm in the same situation on another app that lives on "/" so I can't use that workaround.

@lukemelia
Copy link
Contributor

Check #25 for the ability to configure this

@rwjblue rwjblue closed this as completed Oct 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants