eta icon indicating copy to clipboard operation
eta copied to clipboard

“strng.replace” is not a function

Open ScolderCreations opened this issue 2 years ago • 1 comments

Describe the bug ETA attempts to use “strng.replace”, which does not exist of course.

To Reproduce Steps to reproduce the behavior:

  1. Use eta.Render function as intended.

Expected behavior ETA should use string.replace, not strng.replace. This would avoid the error(?) Screenshots If applicable, add screenshots to help explain your problem.

Package & Environment Details

  • Environment: NodeJS
  • Version: 16.13.2

ScolderCreations avatar Jul 12 '22 01:07 ScolderCreations

This problem doesn't come out of string.replace being used instead, strng is an internal variable used inside of the parsing function, and is used for whitespace trimming. Could you share what exactly your template is, because it doesn't seem this problem is showing up at all for me.

shadowtime2000 avatar Jul 12 '22 01:07 shadowtime2000

Closing this as stale.

nebrelbug avatar Dec 13 '22 03:12 nebrelbug

Still having the problem. How does one reopen an issue?

ScolderCreations avatar Jan 16 '23 17:01 ScolderCreations

@ScolderCreations could you send me a reproducible example of the error?

nebrelbug avatar Jan 17 '23 20:01 nebrelbug

I was able to reproduce this by mistakenly passing a Buffer to Eta.renderString instead of a String. I got the buffer from calling fs.readFile without an encoding argument.

lopopolo avatar Jan 30 '24 03:01 lopopolo