You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[11ty] 1. Having trouble rendering webc template ./src/pages/home.webc (via TemplateContentRenderError)
[11ty] 2. Date is not a constructor (via TypeError)
[11ty]
[11ty] Original error stack trace: evalmachine.<anonymous>:2
[11ty] new Date().toString();
[11ty] ^
[11ty]
[11ty] TypeError: Date is not a constructor
[11ty] at evalmachine.<anonymous>:2:3
[11ty] at Script.runInContext (node:vm:139:12)
[11ty] at Script.runInNewContext (node:vm:144:17)
[11ty] at Object.runInNewContext (node:vm:298:38)
[11ty] at Function.evaluateScript (/home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/moduleScript.cjs:62:25)
[11ty] at Object.<anonymous> (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:130:24)
[11ty] at AstSerializer.transformContent (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:802:42)
[11ty] at AstSerializer.compileNode (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:1216:20)
[11ty] at AstSerializer.getChildContent (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:646:40)
[11ty] at AstSerializer.compileNode (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:1353:46)
[11ty] 1. Having trouble rendering webc template ./src/pages/home.webc (via TemplateContentRenderError)
[11ty] 2. parseInt is not a function(via TypeError)
[11ty]
[11ty] Original error stack trace: evalmachine.<anonymous>:2
[11ty] const num = parseInt("1");
[11ty] ^
[11ty]
[11ty] TypeError: parseInt is not a function
[11ty] at evalmachine.<anonymous>:2:15
[11ty] at Script.runInContext (node:vm:139:12)
[11ty] at Script.runInNewContext (node:vm:144:17)
[11ty] at Object.runInNewContext (node:vm:298:38)
[11ty] at Function.evaluateScript (/home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/moduleScript.cjs:62:25)
[11ty] at Object.<anonymous> (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:130:24)
[11ty] at AstSerializer.transformContent (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:802:42)
[11ty] at AstSerializer.compileNode (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:1216:20)
[11ty] at AstSerializer.getChildContent (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:646:40)
[11ty] at AstSerializer.compileNode (file:///home/mathieu/webc-starter-kit/node_modules/@11ty/webc/src/ast.js:1353:46)
I'm using Eleventy v2.0.0 with webc v0.8.1. I will investigate more and report here.
The text was updated successfully, but these errors were encountered:
solution-loisir
changed the title
What are the limitation of webc:type="js"
What are the limitations of webc:type="js"Feb 18, 2023
From the documentation I was expecting to be able to run any arbitrary server side (Node scripts) JavaScript inside
webc:type="js"
.Yet, I'm getting errors when trying to use JS built-in methods and constructors. For example, the following code.
comp-onent.webc
Will yield this error:
[11ty] 1. Having trouble rendering webc template ./src/pages/home.webc (via TemplateContentRenderError)
Also, trying to use
parseInt
like so:comp-onent.webc
Will throw:
[11ty] 1. Having trouble rendering webc template ./src/pages/home.webc (via TemplateContentRenderError)
I'm using Eleventy v2.0.0 with webc v0.8.1. I will investigate more and report here.
The text was updated successfully, but these errors were encountered: