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

How to use handlebars in es4x? #596

Open
guydeschepper opened this issue Nov 23, 2022 · 2 comments
Open

How to use handlebars in es4x? #596

guydeschepper opened this issue Nov 23, 2022 · 2 comments
Assignees

Comments

@guydeschepper
Copy link

I'm trying to use handlebars in es4x, but it's throwing the following error:

Failed in deploying verticle caused by TypeError: Access to host class io.vertx.ext.web.handler.APIKeyHandler is not allowed or does not exist.

This can be reproduced with the following code:

/// <reference types="@vertx/core" />
// @ts-check
import { Router, TemplateHandler } from '@vertx/web';
import * as hb from '@vertx/web-templ-handlebars';

const engine = hb.HandlebarsTemplateEngine.create(vertx);
console.log('started');

The same code (equivalent) works fine in Vert.x java

@pmlopes pmlopes self-assigned this Nov 23, 2022
@pmlopes
Copy link
Contributor

pmlopes commented Nov 23, 2022

That's odd, it sounds like the jars in your classpath are corrupted because it misses that class. Can you try to remove you node_modules and try again? if it still fails, can you show the listing of node_modules/.libs ? I'd like to see if for some reason the wrong version of modules is getting picked by npm.

@guydeschepper
Copy link
Author

guydeschepper commented Nov 23, 2022

You were right, some jars were missing from the .lib folder.

this is the listing before removing node_modules:

$  ls -lFa node_modules/.lib/
total 47096
drwxrwxr-x 2 guy guy     4096 Nov 23 14:10 ./
drwxrwxr-x 7 guy guy     4096 Nov 23 16:54 ../
-rw-rw-r-- 1 guy guy  1064498 Nov 23 14:10 chromeinspector-22.3.0.jar
-rw-rw-r-- 1 guy guy    90271 Nov 23 14:10 es4x-0.19.1.jar
-rw-rw-r-- 1 guy guy 13963762 Nov 23 14:10 icu4j-71.1.jar
-rw-rw-r-- 1 guy guy   374895 Nov 23 14:10 jackson-core-2.13.4.jar
-rw-rw-r-- 1 guy guy 23528151 Nov 23 14:10 js-22.3.0.jar
-rw-rw-r-- 1 guy guy   304664 Nov 23 14:10 netty-buffer-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   339155 Nov 23 14:10 netty-codec-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy    65442 Nov 23 14:10 netty-codec-dns-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   645606 Nov 23 14:10 netty-codec-http-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   474785 Nov 23 14:10 netty-codec-http2-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   119071 Nov 23 14:10 netty-codec-socks-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   653880 Nov 23 14:10 netty-common-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   538569 Nov 23 14:10 netty-handler-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy    23958 Nov 23 14:10 netty-handler-proxy-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy    37776 Nov 23 14:10 netty-resolver-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   156868 Nov 23 14:10 netty-resolver-dns-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   485752 Nov 23 14:10 netty-transport-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy    43684 Nov 23 14:10 netty-transport-native-unix-common-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   643438 Nov 23 14:10 profiler-22.3.0.jar
-rw-rw-r-- 1 guy guy  3118855 Nov 23 14:10 regex-22.3.0.jar
-rw-rw-r-- 1 guy guy  1500743 Nov 23 14:10 vertx-core-4.3.4.jar

and this is the listing after a clean npm install:

$  ls -lF node_modules/.lib/
total 48696
-rw-rw-r-- 1 guy guy  1064498 Nov 23 19:16 chromeinspector-22.3.0.jar
-rw-rw-r-- 1 guy guy    90271 Nov 23 19:16 es4x-0.19.1.jar
-rw-rw-r-- 1 guy guy   950443 Nov 23 19:16 handlebars-4.3.0.jar
-rw-rw-r-- 1 guy guy 13963762 Nov 23 19:16 icu4j-71.1.jar
-rw-rw-r-- 1 guy guy   374895 Nov 23 19:16 jackson-core-2.13.4.jar
-rw-rw-r-- 1 guy guy 23528151 Nov 23 19:16 js-22.3.0.jar
-rw-rw-r-- 1 guy guy   304664 Nov 23 19:16 netty-buffer-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   339155 Nov 23 19:16 netty-codec-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy    65442 Nov 23 19:16 netty-codec-dns-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   645606 Nov 23 19:16 netty-codec-http-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   474785 Nov 23 19:16 netty-codec-http2-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   119071 Nov 23 19:16 netty-codec-socks-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   653880 Nov 23 19:16 netty-common-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   538569 Nov 23 19:16 netty-handler-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy    23958 Nov 23 19:16 netty-handler-proxy-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy    37776 Nov 23 19:16 netty-resolver-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   156868 Nov 23 19:16 netty-resolver-dns-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   485752 Nov 23 19:16 netty-transport-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy    43684 Nov 23 19:16 netty-transport-native-unix-common-4.1.82.Final.jar
-rw-rw-r-- 1 guy guy   643438 Nov 23 19:16 profiler-22.3.0.jar
-rw-rw-r-- 1 guy guy  3118855 Nov 23 19:16 regex-22.3.0.jar
-rw-rw-r-- 1 guy guy    41071 Nov 23 19:16 slf4j-api-1.7.21.jar
-rw-rw-r-- 1 guy guy   134156 Nov 23 19:16 vertx-auth-common-4.3.4.jar
-rw-rw-r-- 1 guy guy    11089 Nov 23 19:16 vertx-bridge-common-4.3.4.jar
-rw-rw-r-- 1 guy guy  1500743 Nov 23 19:16 vertx-core-4.3.4.jar
-rw-rw-r-- 1 guy guy    99431 Nov 23 19:16 vertx-unit-4.3.4.jar
-rw-rw-r-- 1 guy guy   359965 Nov 23 19:16 vertx-web-4.3.4.jar
-rw-rw-r-- 1 guy guy    23953 Nov 23 19:16 vertx-web-common-4.3.4.jar
-rw-rw-r-- 1 guy guy    11447 Nov 23 19:16 vertx-web-templ-handlebars-4.3.4.jar

So it seems that npm install <library> doesn't add the necessary jars to the .lib folder

(edited to fix the formatting of the listings)

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