Closed namdao2000 closed 2 years ago
@namdao2000 I see that there are some versions mixed together that are conflicting. From your report:
node_modules/@vertx/web/node_modules/@vertx/core/index.d.ts:9036:9
node_modules/@vertx/core/index.d.ts:9062:9
If I look up the sources, the latest reference seems correct to the latest version 0.17.0
but the previous one doesn't match, so I'm assuming it's from an older release.
Usually, NPM should have created a flat dependency node_modules
, so I'm guessing that there's some misalignment with your project?
Maybe a rm -Rf node_modules
and npm install
may fix it?
Hello @pmlopes
Firstly, I want to say thank you so much for your prompt reply. I've been down the rabbit hole of trying to build the most performant REST API server using the Nodejs/Typescript ecosystem. This is awesome!
As to your suggested fix, I tried it and it did not work for me. So I then tried to rm -rf node_mdules
again and changed my dependency versions in package.json file to latest
instead of specific versions.
"dependencies": {
"@vertx/core": "latest",
"@vertx/web": "latest"
},
"devDependencies": {
"@es4x/create": "latest",
"@vertx/unit": "latest",
"typescript": "^4.5.5"
},
Then I ran npm install
, npm start
and the program is now only throwing 1 error:
node_modules/@vertx/web/options.d.ts:40:10 - error TS2305: Module '"@vertx/bridge-common"' has no exported member 'BridgeOptions'.
40 import { BridgeOptions } from '@vertx/bridge-common';
~~~~~~~~~~~~~
Found 1 error.
Thank you once again!
Update:
I found that when I edited the node_modules/@vertx/web/options.d.ts:40
from:
import { BridgeOptions } from '@vertx/bridge-common';
to:
import { BridgeOptions } from '@vertx/bridge-common/options';
Fixes the issue
@namdao2000 indeed, this is a bug in the definition file generator!
Thank you for working on that @pmlopes! I see you have a PR opened - as soon as that is fixed, I can start using es4x + typescript 😁
@namdao2000 I understand, the only thing blocking me atm is that i keep the es4x releases aligned with the upstream vertx releases (because the generated code must match the underlying implementation).
Once there is a vert.x 4.2.5 or 4.3.0 i can release this. For the moment, the only way to hack this is to manually patch the offending file like you noticed.
Description
Im trying to use the router module from @vertx/web and I am running into 7 errors. I followed the starter guide here
Steps to reproduce this bug:
es4x project --ts
and runnpm install @vertx/web --save-prod
npm install
index.ts
code from belownpm start
Error
Code
My
index.ts
code: