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

Failed to find a valid digest in the 'integrity' attribute for resource #5040

Closed
wayne-o opened this issue Nov 5, 2015 · 12 comments
Closed

Comments

@wayne-o
Copy link

wayne-o commented Nov 5, 2015

Hi

Getting the following:

Failed to find a valid digest in the 'integrity' attribute for resource 'http://localhost:7357/testem.js' with computed SHA-256 integrity 'lh8NuSGzYSb6XpdfBYsEglnfxBdd6LpuYybvxZC97fM='. The resource has been blocked.

With:

DEBUG: -------------------------------
ember.debug.js:5240 DEBUG: Ember             : 2.1.0
ember.debug.js:5240 DEBUG: Ember Data        : 2.1.0
ember.debug.js:5240 DEBUG: jQuery            : 1.11.3
ember.debug.js:5240 DEBUG: Ember Simple Auth : 1.0.0
ember.debug.js:5240 DEBUG: -------------------------------

Have searched the open bugs and not found anything pertaining to this.

Is anyone aware of an issue here?

Cheers

@rwjblue
Copy link
Member

rwjblue commented Nov 5, 2015

This is fixed on master, but you can add

integrity=""

To the script tag loading testem.js in tests/index.html

@emad-elsaid
Copy link

@stefanpenner May i ask why this bug is closed? i faced it in my app emad-elsaid/devtools#26
i made a workaround by adding integrity="" but i can't find the root cause or a related commit that solved it, any hints?

@stefanpenner
Copy link
Contributor

i made a workaround by adding integrity=""

this is the solution, and new ember-cli blueprints ship with integrity="" on testem.js script tag.

@sheriffderek
Copy link

Just for the record - and for people upgrading or still hitting this: Recently upgraded an app from 2.0 to 2.4. Ran into this error. testem.js already had the integrity="" though. There was an SHA-256 string in the /assets/my-app.js integrity ='asdfsa' though... and when I removed the string the app would load.

@borisrorsvort
Copy link

Its happening again indeed. Ember version 2.4.1

@stefanpenner
Copy link
Contributor

Its happening again indeed. Ember version 2.4.1

I do not believe to be the case (having just upgraded several apps, without issue), have you followed the instructions?

@borisrorsvort
Copy link

I mean its working with integrity="". But is it the solution ?

@stefanpenner
Copy link
Contributor

I mean its working with integrity="". But is it the solution ?

yes

@ziali088
Copy link

ziali088 commented Jul 5, 2016

I've ran into this issue when building my application in production mode, the contents of dist/index.html show that the sri hashes were generated for all the javascript/css files, eg

<script src="assets/vendor-9d6efb5c3b35b8a645637f53779d1d7c.js" integrity="sha256-EtU1Rm2XQeNj0QMonA9FMqK26HZYnKb4TkyZfvSWQ= sha512 -C40xcfgWFRIEi0RbQhA/2WMo6ripG2fJksLw9noG5+khSL+a8nWVPwOKKmBWdGmvOXY99HecZvpu/SGtSGhxrQ==" ></script>

I'm using
Ember 2.6.0
Ember-CLI 2.4.2
Ember-CLI-SRI 2.1.0

The command I used was ember build -prod which generated those hashes, I don't think modifying the contents of those automatically generated files would be a proper solution. Is there any suggestion on how to fix this?

@nathanhammond
Copy link
Contributor

@ziali088 I don't think that you're talking about the same issue. If you still believe what you're encountering is a bug open a new issue and explain your problem from the beginning (including expected behavior and actual results). I suspect however that you're not triggering a bug and you'd be better served by dropping by #-ember-cli.

@The-Don-Himself
Copy link

@ziali088 Don't know if you ever solved your issue but I also ran into the same error messages while in production I'm on the latest Chrome (Version 55). Took a while but the problem was due to having Cloudflare settings Auto-minify css and js on, which is the default. Turning those off solved the issue, since my resources were already minified at source anyway.

@nathanhammond @rwjblue should this be documented/pointed out that external elements could also lead to this exact issue other that integrity="" ?

@viktorprogger
Copy link

viktorprogger commented Jun 20, 2017

I've got the same issue except a bit. I've generated the code with ember build -prod and placed it to the hosting.
Now I can visit the site with Chrome Desktop, but there is the error when I'm visiting the site with Chrome Mobile. How should I generate production version which will work in all modern browsers?
P.S. There are non-empty integity attributes on every script and style tag. Clearing them is a tempopary solution but I want to use continious integration and comtiniuos delivery what is impossible with this bug.

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

10 participants