question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using local url as source

See original GitHub issue

Using 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:closed
  • Created 7 years ago
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bezoerbcommented, May 8, 2016

@miralize, @mikeebee I’ve added a fix for this issue. Could you please check again using the master branch? Thanks @pocketjoso 😃

0reactions
bezoerbcommented, Nov 30, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found