We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No matter what I do, I can't get the pdf to render using Gotenberg.
The PDF only ever renders with Failed to render HTML. Error: Undefined variable $username
Failed to render HTML. Error: Undefined variable $username
My template <h2>Hello {{ $username }}</h2>
<h2>Hello {{ $username }}</h2>
Default variables
{ "username": "username_missing" }
cURL
curl --request POST \ --url http://localhost:8888/api/v1/document-templates/9d4186c0-4bd0-4732-8fb0-2944132d31b1/pdfs \ --header 'content-type: application/json' \ --data '{ "variables": { "username": "sam.n", } }'
docker log
docking-1 | {"message":"Undefined variable $username","context":{"view":{"view":"/var/www/html/storage/framework/views/8d5b3624fbd57ccbbace3317aac77a67.blade.php","data":[]},"exception":{"class":"Spatie\\LaravelIgnition\\Exceptions\\ViewException","message":"Undefined variable $username","code":0,"file":"/var/www/html/storage/framework/views/8d5b3624fbd57ccbbace3317aac77a67.blade.php:1","previous":{"class":"ErrorException","message":"Undefined variable $username","code":0,"file":"/var/www/html/storage/framework/views/464daea1acbb9d2710318291b7aff0fb.php:1"}}},"level":400,"level_name":"ERROR","channel":"production","datetime":"2024-10-16T03:07:49.538753+00:00","extra":{}} gotenberg-1 | {"level":"info","ts":1729048069.5986624,"logger":"api","msg":"request handled","trace":"736acea2-312e-4c0f-ac86-89ae30600cb9","remote_ip":"172.18.0.3","host":"gotenberg:3000","uri":"/forms/chromium/convert/html","method":"POST","path":"/forms/chromium/convert/html","referer":"","user_agent":"GuzzleHttp/7","status":200,"latency":53202208,"latency_human":"53.202208ms","bytes_in":267,"bytes_out":20134}
Running with docker-compose.yml
services: docking: image: "ghcr.io/shipsaas/docking:latest" env_file: .env volumes: - ./docking.sqlite:/var/www/html/docking.sqlite - app_storage:/var/www/html/storage/app links: - gotenberg ports: - '8888:80' gotenberg: image: gotenberg/gotenberg:8 volumes: app_storage:
The text was updated successfully, but these errors were encountered:
it works for me, you have to fix your post request (no comma after "sam.n")
curl --request POST \ --url http://localhost:8888/api/v1/document-templates/9d4186c0-4bd0-4732-8fb0-2944132d31b1/pdfs \ --header 'content-type: application/json' \ --data '{ "variables": { "username": "sam.n" } }'
Sorry, something went wrong.
No branches or pull requests
No matter what I do, I can't get the pdf to render using Gotenberg.
The PDF only ever renders with
Failed to render HTML. Error: Undefined variable $username
My template
<h2>Hello {{ $username }}</h2>
Default variables
cURL
docker log
Running with docker-compose.yml
The text was updated successfully, but these errors were encountered: