njs icon indicating copy to clipboard operation
njs copied to clipboard

SyntaxError: Cannot find module "http/hello.js"

Open magic-thomas opened this issue 3 years ago • 1 comments

My versions.

NGINX_VERSION=1.23.1
NGINX_NJS_VERSION=0.7.6

I have njs trouble. I guess it is about js_import .

http {
    js_path "/data/njs/";
    js_import hello from http/hello.js;
}

This is the display in /data/njs , with 'tree' command.

.
└── http
    └── hello.js

If nginx start, error comes.

nginx: [emerg] SyntaxError: Cannot find module "http/hello.js" in /etc/nginx/:1

I really can not understand why it happens.

How can I fix this ?

magic-thomas avatar Oct 01 '22 19:10 magic-thomas

Hi @magic-thomas,

Was you able to solve the issue?

xeioex avatar Oct 07 '22 03:10 xeioex