Skip to content
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

Impossible to debug templates as a template author #3009

Open
radu-matei opened this issue Feb 7, 2025 · 2 comments
Open

Impossible to debug templates as a template author #3009

radu-matei opened this issue Feb 7, 2025 · 2 comments

Comments

@radu-matei
Copy link
Member

I am updating a template I built a long time ago.

I have no idea what variable it's complaining about:

RUST_LOG=spin=trace spin new -t nextjs-ui deleteme
Description: Next.js UI
HTTP path: /...
2025-02-07T21:54:37.289707Z DEBUG spin: err=liquid: Unknown variable
  with:
    requested variable=member

Error: liquid: Unknown variable
  with:
    requested variable=member

How could I find out what variable it is referring to?

@lann
Copy link
Collaborator

lann commented Feb 10, 2025

Is it not...member?

@itowlson
Copy link
Collaborator

Could you share the repro case please? My reaction is the same as Lann's, but that seems so obvious that I assume you've already considered and rejected it. Without the actual template, therefore, it's hard to know what is being misreported.

(For what it's worth, my guess is that your app uses Handlebars or such like, contains code referring to e.g. {{ member }}, and does not escape the {{ ... }} (https://developer.fermyon.com/spin/v3/template-authoring#expression-syntax). If I guessed right, the template system would see the {{ member }} and look for a template variable named {{ member }}. But without the source code it's really hard to tell. Did I mention "guess"?)

I'll have a look and see if Liquid can give us locations - that would certainly help authors track down such problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants