Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graal parsing error on JS syntax #25

Closed
ibrahimatcha opened this issue Dec 12, 2023 · 2 comments
Closed

Graal parsing error on JS syntax #25

ibrahimatcha opened this issue Dec 12, 2023 · 2 comments

Comments

@ibrahimatcha
Copy link

Hi,

This is my usage of Pug4J:

PugTemplate template;
PugConfiguration config = new PugConfiguration();
config.setExpressionHandler(new GraalJsExpressionHandler());
try {
        template = config.getTemplate("src/main/resources/template/pdf-body.template.pug");
} catch (IOException e) {
        logger.error("Error getting PUG template");
        throw new RuntimeException(e);
}

HashMap<String, Object> objects = new HashMap<>();
objects.put("vehicleCheck", vehicleCheck);
objects.put("summary", summary);
objects.put("mileageGraph", mileageGraph);

return config.renderTemplate(template, objects);

When it tried running the getTemplate code, it produces an exception with this message:
Syntax Error: unable to evaluate [summary.issues().status() === 'NO_ISSUES'] - Parsing de.neuland.pug4j.expression.JexlExpressionHandler.assertExpression@1:29 parsing error in '='

It is complaining about the === which is pure JS syntax so I'm confused what the issue is since I'm using the GraalJsExpressionHandler. Please advise

@chbloemer
Copy link
Contributor

Until pug4j 2.0.3 Jexl was still used for assertions. 2.0.4 and up should be GraalsJS only.

chbloemer added a commit that referenced this issue Dec 16, 2024
@chbloemer
Copy link
Contributor

Can't reproduce on current master. I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants