TimeoutError: Navigation timeout of 30000 ms exceeded (only in with localhost url's) #516
Replies: 16 comments 10 replies
-
Have you ever found an solution for this? I'm getting a similar issue, but also only with the localhost. Calling google.com or any other website works just fine.
|
Beta Was this translation helpful? Give feedback.
-
Ok. I had the same issue of timeout of 30000 ms when try to convert a view on Localhost. I was running it via
The issue seems to be that puppeteer is not handling local network requests. For now I have gotten it to work as follows: @env('local')
@php
echo '<style>' . file_get_contents(realpath(public_path('css/app.css'))) . '</style>';
@endphp
@endenv
@env(['staging', 'production'])
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
@endenv The above works without a hitch. So something is up with localhost uri resources in puppeteer. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am having the same error in my production website, sometimes it can create images and maximum time it can't create images. |
Beta Was this translation helpful? Give feedback.
-
Hello, Same error here on localhost
The strangest thing is that the exact same code works on Tinkerwell but not on the browser, still looking for a solution... |
Beta Was this translation helpful? Give feedback.
-
I found a possible solution on internet. This worked for me. $ result ------> /usr/local/bin/node (may be different) $ $ |
Beta Was this translation helpful? Give feedback.
-
I'm having the same problem on a Laravel Sail install of 20.04... works fine when I push to staging server hosted on Forge. So it's a local resource issue. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
I have resolved my problem by minimizing the CSS and JS file, if possible you may try by minimizing your CSS and JS file |
Beta Was this translation helpful? Give feedback.
-
I'm currently having this issue as well. I am running on Windows using a Docker container for my app. To test, I've created an html file inside of the public folder called |
Beta Was this translation helpful? Give feedback.
-
Are y'all using Sail or plain Laravel Sail is using When running a Browsershot command in e.g. Tinkerwell everything works fine. Also, calling external URLs is working too. So how can we make Browsershot work while running Laravel with |
Beta Was this translation helpful? Give feedback.
-
I think I found a solution for using Browsershot with
By using the queue the blocking request from my explanation above is shifted to be before Browsershot. I wanted to use queue jobs for PDF rendering anyway so it's not a deal for me, might be for others. |
Beta Was this translation helpful? Give feedback.
-
Another solution to test locally would be on using Ngrok ie: |
Beta Was this translation helpful? Give feedback.
-
For me the solution in development has been to access to the shell with Hope it helps to someone else. |
Beta Was this translation helpful? Give feedback.
-
Other option is to set the PHP_CLI_SERVER_WORKERS environment variable bigger than 1, and then the built-in php server can handle more than one request at the same time. This option exists from php7.4. It's easy to find how to configure it in sail just googling it. Hope it helps someone else. |
Beta Was this translation helpful? Give feedback.
-
Sometime if you have image then you need to convert the image to base64. Converting to base64
Generation of base64 Using base64 in blade |
Beta Was this translation helpful? Give feedback.
-
👋 Similar here. The funny thing about this error is you can see in the discussion people sets the timeout to 60 or 120 but it fails at 30000ms anyone have any clue why that happens? Is like timeout option is not respected |
Beta Was this translation helpful? Give feedback.
-
I was also getting this issue, but then I tried to take a snapshot of google.com, and it was successful. The issue was with my page, which I was trying to take a screenshot of. The page had JavaScript code that triggered an alert('hi'); on load. I removed that JavaScript code, and it worked. Now, can anyone tell me how to ignore and take a snapshot despite such JavaScript alerts? |
Beta Was this translation helpful? Give feedback.
-
Hello guys
i have this error
The command "PATH=$PATH:/usr/local/bin NODE_PATH=
npm root -gnode '/Volumes/Data/www/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"http:\/\/localhost:8000\/test","action":"screenshot","options":{"type":"png","args":[],"viewport":{"width":800,"height":600}}}'" failed. Exit Code: 1(General error) Working directory: /Volumes/Data/www/public Output: ================ Error Output: ================ TimeoutError: Navigation timeout of 30000 ms exceeded at /Volumes/Data/www/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111 at async FrameManager.navigateFrame (/Volumes/Data/www/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:90:21) at async Frame.goto (/Volumes/Data/www/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:416:16) at async Page.goto (/Volumes/Data/www/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:821:16) at async callChrome (/Volumes/Data/www/vendor/spatie/browsershot/bin/browser.js:191:9)
and this code works with other links
And the http://localhost:8000/test link is working
Beta Was this translation helpful? Give feedback.
All reactions