question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting undefined when using <raw> or @{{

See original GitHub issue

I’m trying to not escape my vars in {{}} but they keep turning into undefined. I wrapped it in <raw> which didn’t fix it, I also added @{{ but that didn’t work for the href’s. Unsure what I’m doing wrong.

  • Maizzle Version: 1.0.7
  • Node.js Version: 13.0.1

Template:

---
title: You have been invited
bodyClass: bg-white h-full font-sans p-4 text-gray-900
htmlClass: bg-white h-full font-sans p-4 text-gray-900
---

<extends src="src/layouts/master.html">
  <block name="template">
    <raw>
      <div>
        <h1 class="mb-4 text-2xl font-bold leading-tight text-black">
          {{ givenName }} invited you to {{ storyName }}
        </h1>
        <p class="mb-12 text-base font-medium leading-tight">
          {{ fullName }} has invited you to edit
          <a href="@{{inviteLink}}" class="underline text-tella"
            >{{ storyName }}</a
          >
          on X.
        </p>
        <a
          href="{{ inviteLink }}"
          class="inline-flex items-center px-6 py-3 text-lg font-medium text-white no-underline border border-transparent rounded h-9 transition ease-in-out duration-150 focus:outline-none hover:shadow bg-tella focus:border-tella focus:shadow-outline-purple active:text-gray-400"
          >Open in X</a
        >
        <component src="src/components/footer.html"></component>
      </div>
    </raw>
  </block>
</extends>

Generated:

<div>
--
  | <h1 class="mb-4 text-2xl font-bold leading-tight text-black">
  | undefined invited you to undefined
  | </h1>
  | <p class="mb-12 text-base font-medium leading-tight">
  | undefined has invited you to edit
  | <a href="@undefined" class="underline text-tella">undefined</a>
  | on Tella.
  | </p>
  | <a href="undefined" class="inline-flex items-center px-6 py-3 text-lg font-medium text-white no-underline border border-transparent rounded h-9 transition ease-in-out duration-150 focus:outline-none hover:shadow bg-tella focus:border-tella focus:shadow-outline-purple active:text-gray-400">Open in Tella</a>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
happylinkscommented, May 9, 2020

Awesome! Thanks for the fast response. Also, Maizzle is great!

0reactions
cossssmincommented, May 23, 2020

Fixed in v1.0.9

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR :- Undefined variable: raw While Transfering data ...
You can simply solve this issue by using the isset() function to avoid undefined variable issue. Try below:
Read more >
Getting "undefined variable 'raw' " message : r/NixOS - Reddit
Getting "undefined variable 'raw' " message. So I am basically getting this error while trying to rebuild my nixos setup, I am just...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
Undefined means that a variable has been declared but has not been assigned a value. In JavaScript, properties and functions can only belong...
Read more >
String.raw() - JavaScript - MDN Web Docs
It's used to get the raw string form of template literals — that is, ... have a raw property, or the raw property...
Read more >
How to check for undefined in JavaScript
If you compared an undeclared variable to undefined or void(0) you would instead get a ReferenceError. But don't use void(0) directly. Avoid ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found