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
Into the Edge file, add double curly braces that either contain nothing, or only contain a comment:
Hello {{ /* world */ }}
Hello {{ }}
Run the project, and see an nondescriptive and hard to understand error:
node_modules/.pnpm/[email protected]/node_modules/edge-parser/build/index.js:419
const Expression = expressions_exports[astExpression.type];
^
TypeError: Cannot read properties of undefined (reading 'type')
at transformAst (node_modules/.pnpm/[email protected]/node_modules/edge-parser/build/index.js:419:56)
at #processMustache (node_modules/.pnpm/[email protected]/node_modules/edge-parser/build/index.js:545:18)
at Parser.processToken (node_modules/.pnpm/[email protected]/node_modules/edge-parser/build/index.js:592:30)
at node_modules/.pnpm/[email protected]/node_modules/edge.js/build/index.js:1349:48
at Array.forEach (<anonymous>)
at Compiler.compile (node_modules/.pnpm/[email protected]/node_modules/edge.js/build/index.js:1349:22)
at Template.render (node_modules/.pnpm/[email protected]/node_modules/edge.js/build/chunk-DA7IVQFT.js:578:43)
at _EdgeRenderer.render (node_modules/.pnpm/[email protected]/node_modules/edge.js/build/index.js:1573:92)
at _Edge.render (node_modules/.pnpm/[email protected]/node_modules/edge.js/build/index.js:1897:34)
at Server.<anonymous> (index.js:9:27)
Node.js v23.6.0
I've spent quite some time looking for the type property in our codebase, until I've realized it's in your codebase.
// edge-parser/src/parser/transform_ast.ts/** * Transform acorn AST to Edge AST. This must always be performed before * writing it to the compiled template buffer. */exportfunctiontransformAst(astExpression: any,filename: string,parser: Parser): any{constExpression=Expressions[astExpression.typeaskeyoftypeofExpressions]if(Expression){returnExpression.toStatement(astExpression,filename,parser)}
Package version
6.2.1
Describe the bug
Hello {{ /* world */ }} Hello {{ }}
I've spent quite some time looking for the
type
property in our codebase, until I've realized it's in your codebase.Throwing a more user-friendly error is advisable.
Reproduction repo
https://github.com/cshaa/edge-bug-empty-moustache
The text was updated successfully, but these errors were encountered: