-
Notifications
You must be signed in to change notification settings - Fork 153
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
Error failed to load... network status 301 #117
Comments
If i run from inside the container |
I see that you have |
@SebastiaanKlippert Thanks for the quickly reply.
|
That looks more like the actual error. It is trying to access you local filesystem but that throws that about:blank error if you don't enable filesystem access. I don't know what the content of your HTML is and what the content of the URLs in I cannot debug remotely, but if you just try the same code with simple HTML input it should work, then try to add a reference in that HTML to a local file and check if it still works. |
Unfortunately I can't share the link because it's private. I'm trying to get clearance to do it. But I can say to you that the HTML code of the link has it's files loaded using relative path. Ex: |
I don't need the link or file, keep it private. But yes that is a known bug in wkhtmltopdf itself, it will not be fixed there. You don't have to read all that, but the summary is that when using stdin in wkhtmltopdf (that is what passing it as a reader in Go does) the working directory is set to your systems TEMP dir. As a workaround you can set absolute paths (that is always better). If you have no control over the source HTML you can replace the links in your Go code (replace |
@SebastiaanKlippert But this will only working with local html files, or am I wrong ? I understand that this fix when I have a local HTML file calling another files with relative path. In my case it's a like that in the HTML is calling files with |
Not sure what you mean, your main HTML file is loaded into memory and that is passed to wkhtmltopdf via stdin. That file cannot load resources with a relative file path (so the HTML cannot contain links to relative files). |
Error probably when try to load assets in html
Please, I need help with this. I'm struggling to make this work with GoLang. The same link I was able to work using Lambda Docker with Python. But I would like to do not add this layer to my Go app. If I don't managed this, I'll have to send this saving process to this Lambda :'(
Error output
Dockerfile
Code
The text was updated successfully, but these errors were encountered: