Error when using local url as source
See original GitHub issueUsing a HTML file url works great, so does a remote url. But when I try to use a local url through MAMP, I get this error…
Unhandled rejection Wrong status code 403 for [object Object]
Any ideas?
Using via npm and Gulp v.0.7.2
Here is my code…
var critical = require('critical');
gulp.task('critical', function(cb) {
critical.generate({
base: './',
src: 'http://localurl.dev',
css: ['css/styles.css'],
dimensions: [{
width: 320,
height: 480
}, {
width: 768,
height: 1024
}, {
width: 1280,
height: 960
}],
dest: '_templates/default_site/_embeds/critical_css_home.html',
extract: false,
include: ['.c-slideshow, .c-more-to-see, .c-slideshow-gallery__container, .c-loader, .c-slideshow--hero'],
exclude: ['@font-face']
});
});
Let me know if you need more information.
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (1 by maintainers)
Top Results From Across the Web
5 Ways To Fix “Not Allowed To Load Local Resource” Error
How to Fix Not Allowed to Load Local Resource Error · Try Disabling the Chrome Security Settings · Change DNS Settings · Clear...
Read more >"Cross origin requests are only supported for HTTP." error ...
My crystal ball says that you are loading the model using either file:// or C:/ , which stays true to the error message...
Read more >Localhost Refused to Connect - How to Fix the Error
Start by navigating to localhost in a different browser. If the connection establishes, then the settings in the initial browser are the issue....
Read more >Allowing cross-origin use of images and canvas - HTML
The canvas method toDataURL() is used to convert the image into a data:// URL representing a PNG image, which is then saved into...
Read more >Troubleshooting Cloudflare 1XXX errors
Common cause. The Cloudflare domain resolves to a local or disallowed IP address or an IP address not associated with the domain. Resolution....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@miralize, @mikeebee I’ve added a fix for this issue. Could you please check again using the
master
branch? Thanks @pocketjoso 😃Closing this as nothing happened in the last 2 years 😉
Think this should be way better with the next version. The prerelease version can be installed with
npm i critical@next
Feel free to reopen if the issue still exists.