ReferenceTroubleshooting

Troubleshooting

Copy page

Fix template errors, missing data in a document, failed Generate document steps in Shopify Flow, and orders older than 60 days.

When a document does not come out the way you expect, there are three places to look:

  1. The preview in the editor - shows a template error with its line as soon as you type it.
  2. Documents in the app - lists failed documents with their error message.
  3. The run details in Shopify Flow - shows why the Generate document step failed.

This page goes through the errors you may meet, by where they appear.

Template errors

The preview shows these instead of the page, and a save is refused with the same message.

Unknown template filter "..." (line N)

The template uses a filter that does not exist here. Filters from Shopify themes, such as theme money or image filters, are not available. Use the filters listed in Template variables and Liquid: money, percent, br, raw and the standard Liquid filters.

The render tag is not available in a document template

The tags render, include, layout and block are not supported. A template is one HTML file without includes. Copy the shared part into each template instead.

A Liquid syntax error with a line number

A tag is not closed or is misspelled, for example a for without endfor or an if without endif. Go to the line in the message and check the tags around it.

The template took longer than 3 s to render

The template does too much work, usually a loop inside a loop over long lists. Simplify the loops.

The template builds more data than a template may

A very large loop, list or text. Reduce what the template builds up in variables.

The template is longer than 200 KB

The HTML is too long. Images pasted into the HTML as data are the usual cause: host the image and reference it by URL instead.

Missing or wrong data in the document

These are not errors: the document is generated, but something is empty or looks different.

A value prints nothing

A variable that does not exist prints nothing, without an error. Check the spelling against the Variables card in the editor: names use underscores, for example order.total_price, order.shipping_address.zip and line.variant_title. Also check that the template renders the right thing: an order template has no product object.

A field is empty for some orders only

Not every order has every value: an order without a shipping address, a line item without a SKU, a customer without a phone number. Wrap optional parts in an if, so the label is only printed when the value exists.

An amount prints as a plain number

Amounts are numbers. Add the money filter to format them with the currency, and percent for a tax rate.

HTML tags are printed as text

Output is escaped. For a value that is HTML, such as product.description_html, add the raw filter. For a text with several lines, such as brand.address, add the br filter.

An image is missing

Images need an absolute URL that is reachable from the internet, starting with https. A relative path or an image on a private network cannot be loaded. A product or line item without an image has an empty image_url: check it with if first.

The font looks different than expected

A Google font is downloaded when the PDF is rendered. If the download fails, a built-in font is used instead. Upload the font file as a custom font in Settings to make it independent of Google. Also check whether the template's own Branding tab sets a different font than your brand.

The document is in the wrong language

The language comes from the Language field of the action, else from the customer, else it is the main language. If the template does not have the language, the main language is rendered. See Templates in several languages.

The preview and the PDF differ

The on-screen preview shows the layout, the PDF shows real pages. Page breaks only exist in the PDF. Use Preview PDF to check them, and control them with CSS. See Paper size, margins and file name.

The preview says no order matches

With A specific order selected, the preview searches by order number. Enter the number as shown in your admin, for example #1001. For a product enter its title, for a customer the email or name.

The Generate document step fails in Flow

Flow shows the message of the failed step in its run details.

No template named "..." in Workflow Documents

The Template name in the action does not match a template. The name is case sensitive. Compare it with Name on the template's Settings tab. This also happens after a template was renamed or deleted.

The template "..." is turned off in Workflow Documents

Select Template is on on the template's Settings tab.

The template renders a product, but this workflow passes no product

The template is about one kind of thing, and the workflow does not have it. Use a trigger that provides it, or choose a template that fits the trigger. Renders on the template's Settings tab says what the template needs.

The plan's documents for the last 30 days are used up

Your allowance is used up. Documents are generated again when the rolling 30-day window frees up, or right away after you change to a larger plan. See Plans and pricing.

The order was not found

The order was deleted, or it is older than 60 days. See the next section.

Shopify did not answer in time, or an internal error

A temporary problem. The step reports a temporary failure and Flow retries it by itself, you do not need to do anything. If it keeps failing, contact us.

Orders older than 60 days

Shopify gives apps access to the orders of the last 60 days. A document for an older order fails with the message that the order was not found, in Flow, in the API and in the preview.

What you can do:

  • Generate documents when the order happens, for example on Order paid, rather than long afterwards.
  • For an older order, download the PDF that was generated at the time from Documents, while your plan keeps it.

Products and customers are not affected by this limit. A customer summary lists the customer's most recent orders.

The link from the Flow action or the API is valid for 7 days. After that, or after the PDF was deleted at the end of your plan's retention, the link stops working. Download the PDF from Documents while it is stored, or generate the document again. See Document history and downloads.

Still stuck?

Report a bug with the template name, the order number and the time of the failed document, or see Support for every way to reach us.