Problem running chirpstack-api javascript code

Im trying to run the example code in https://www.npmjs.com/package/@chirpstack/chirpstack-api/v/3.12.4 , I had to add .js in the en of the imports, but Im still getting errors, Im getting:
"const loginRequest = new internalMessages.LoginRequest();
^

TypeError: internalMessages.LoginRequest is not a constructor
at file:///c:/Users/SunandPlay/Desktop/javascript/chirp-estesi.js:13:22
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async loadESM (node:internal/process/esm_loader:88:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)"

Im running the code on VSC, whit Code Runner and JavaScript (ES6) extension, I have Nodejs installed
Im posting this here because Im using the code provided by chirpstack.
Beforehand thank you very much

I am getting the same error too. The example code must be really old. I had to change the imports:

import * as internalService from '@chirpstack/chirpstack-api/as/external/api/internal_grpc_pb';
import * as internalMessages from '@chirpstack/chirpstack-api/as/external/api/internal_pb';

to

import * as internalService from '@chirpstack/chirpstack-api/api/internal_grpc_pb.js';
import * as internalMessages from '@chirpstack/chirpstack-api/api/internal_pb.js';

but I am still getting the error “internalMessages.LoginRequest is not a constructor” at this code:
const loginRequest = new internalMessages.LoginRequest();

Did anybody found the solution for this error

Did you try THIS?