hapijs / boom

HTTP-friendly error objects
Other
2.94k stars 192 forks source link

Error TS2709: Cannot use namespace 'Boom' as a type. #248

Closed dwisetiyadi closed 5 years ago

dwisetiyadi commented 5 years ago

Hi,

I got this error three days ago, before that days everythings is ok. Actually I didn't yet use Boom, my dependencies:

"@hapi/hapi": "^18.3.1",
"@hapi/inert": "^5.2.1",
"@types/hapi": "^18.0.2",
"@types/hapi__hapi": "^18.2.5",
"@types/hapi__inert": "^5.2.0",

And this the detailed error:

tsc node_modules/@types/hapi__hapi/index.d.ts(514,32): error TS2709: Cannot use namespace 'Boom' as a type. node_modules/@types/hapi__hapi/index.d.ts(4050,18): error TS2709: Cannot use namespace 'Boom' as a type. src/index.ts(7,10): error TS2305: Module '"../node_modules/@hapi/boom/lib"' has no exported member 'serverUnavailable'. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! nodejs@0.1.0 seed: tsc npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the nodejs@0.1.0 tsc script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! nodejs@0.1.0 build:development: tsc && pm2 start ecosystem.config.js --env development --no-daemon npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the nodejs-server-app-vanilla@0.1.0 build:development script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Please help...

hueniverse commented 5 years ago

Where is boom being required/imported?

zamu87 commented 5 years ago

Hi, i've got the same problem, it's because @hapi/hapi depends on @hapi/boom that now contains types definitions and @types/hapihapi depends on @types/hapiboom that contains different definitions that are not compatible with ones contained in @hapi/boom

sunknudsen commented 5 years ago

Same, issue appeared after upgrading from @hapi/boom@7.4.3 to @hapi/boom@7.4.10.

hueniverse commented 5 years ago

Removed types from 7.x. Will put them back on 8.x. If you have types issues between the new boom types and external DT types, don't upgrade to v8 until the full hapi ecosystem is properly upgraded its types and they are all in sync.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.