maizzle / framework

Quickly build HTML emails with Tailwind CSS.
https://maizzle.com
MIT License
1.24k stars 49 forks source link

<raw> doesn't work in components (vars are still evaluated at build time) #286

Closed AntonioAngelino closed 4 years ago

AntonioAngelino commented 4 years ago

We got the following error when we try to compile a template that embeds our footer component. The footer.html template has a {{config.notification_settings_url}} variable that must not be avaluate at build time. We tried to wrap the variable using the component with no luck.

$ maizzle build
✖ Failed to compile build_local/notifications/notification-tpl.html
(node:598) UnhandledPromiseRejectionWarning: ReferenceError: config is not defined
(node:598) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:598) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
cossssmin commented 4 years ago

Update Maizzle to the latest version, using <raw> inside components (or passing them as content to components) works fine.

Bump the version in your package.json, then run npm install to update.

"dependencies": {
-    "@maizzle/framework": "^1.1.1"
+    "@maizzle/framework": "^1.4.3"
  },
cossssmin commented 4 years ago

Feel free to reopen if you're still experiencing issues after the update.