Hapi: Updating from 16.4.3 to 16.5.0: Podium.decorate is not a function error

Created on 21 Jul 2017  ยท  13Comments  ยท  Source: hapijs/hapi

Are you sure this is an issue with hapi or are you just looking for some help?

I'm not entierly sure this issue is originating from hapi itself, but when I update to 16.5.0 and I do a request, I get this error:
/.../node_modules/hapi/lib/request.js:63 Podium.decorate(this, internals.emitter); ^ TypeError: Podium.decorate is not a function at new internals.Request (/.../node_modules/hapi/lib/request.js:63:12) at module.exports.internals.Generator.internals.Generator.request (/.../node_modules/hapi/lib/request.js:32:21) at Server.<anonymous> (/.../node_modules/hapi/lib/connection.js:260:48) at emitTwo (events.js:125:13) at Server.emit (events.js:213:7) at parserOnIncoming (_http_server.js:602:12) at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
(I replaced the long path tih ... for readability)

What are you trying to achieve or the steps to reproduce?

yarn add [email protected] introduces the problem.
yarn add [email protected] resolved the issue.

I repeated the steps a couple of times, and it is really the upgrade of hapi that triggers the issue.

  • node version: 8.2.0
  • hapi version: 16.5.0
  • os: ubuntu 16.04
dependency

Most helpful comment

rm -rf node_modules && rm package-lock.json && npm install helped in our case.

All 13 comments

No issue with npm here, try to wipe your dependencies and reinstall, it looks like a yarn or local issue.

3542 only updates npm-shrinkwrap.json. package.json still points to "podium": "1.x.x".

So it looks like a packaging bug to me.

I am not seeing the issue and I do not support yarn (in that I do not test deployments with it or use it).

@hueniverse Ok, that's fair. But the issue @fabiob pointed at, can you still make that change? It would solve it, and make the package.json more in sync with what is actually needed.

I know it's pretty edge case, but this error also happens with [email protected] if you have a project that has two different deps that rely on hapi, and one uses 16.3 and the other uses 16.5.

@nrn Your issue is likely due to using package-lock=false (See https://github.com/hapijs/hapi/issues/3556).

@kanongil Unfortunately we do use the lock file, and haven't turned that setting off.

Thanks for fixing this @hueniverse!

This happens to me with:

  • macOS 10.12.6
  • node 8.4
  • npm 5.3.0
  • hapi 16.5.2

The project is here: https://github.com/FNSKtZH/apflora_api

Exact same project runs fine under Windows 10.

I nuked node_modules several times but the issue remains.

npm list hapi shows only a single hapi installation, v16.5.2.

npm list podium shows that podium is installed as dependency of hapi in v1.2.5.

Adding podium 1.3.0 as peerDependency solved the issue.

Can confirm that on npm 5.x, somehow podium 1.2.5 is installed even with hapijs 16.5.2. Can we have a patch in hapi v16 that explicitly sets the version for podium?

Seeing the same issue.

$ npm list hapi
npm list [email protected] ~/projects/jsperf.com
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]  deduped
โ””โ”€โ”€ [email protected]

$ npm list podium
[email protected] ~/projects/jsperf.com
โ””โ”€โ”ฌ [email protected]
  โ””โ”€โ”€ [email protected]

rm -rf node_modules && rm package-lock.json && npm install helped in our case.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeremiahlee picture jeremiahlee  ยท  4Comments

arb picture arb  ยท  4Comments

jeffbski picture jeffbski  ยท  5Comments

foobar1123 picture foobar1123  ยท  3Comments

DrMabuse23 picture DrMabuse23  ยท  5Comments