hapijs / h2o2

Proxy handler for hapi.js
Other
165 stars 66 forks source link

Invalid template variable "#label" fails due to: Formula is not a constructor #114

Closed pgangwani closed 4 years ago

pgangwani commented 4 years ago

Support plan

Context

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

  1. Upgrading node to lts
  2. upgraded hapi modules compatible
  3. webpack build
  4. node start

What was the result you got?

/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/template.js:213
            throw err;
            ^

TypeError: Invalid template variable "#label" fails due to: Formula is not a constructor
    at module.exports.internals.Template._ref (/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/template.js:209:27)
    at module.exports.internals.Template._parse (/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/template.js:82:34)
    at new module.exports.internals.Template (/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/template.js:42:14)
    at Object.exports.compile (/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/messages.js:45:28)
    at Object.exports.merge (/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/messages.js:117:24)
    at Object.exports.type (/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/extend.js:24:29)
    at internals.Base.extend (/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/base.js:434:23)
    at Object.<anonymous> (/Users/pgangaw/global-header-footer/node_modules/@hapi/h2o2/node_modules/@hapi/joi/lib/types/any.js:13:23)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)

What result did you expect?

node server should start smoothly

Marsup commented 4 years ago

Looks like you've got a bad install, do you have a lock file messing things up ? Can you show the result of npm ls @hapi/formula ?

pgangwani commented 4 years ago

@Marsup : Hope it helps yoou what you looking for

├─┬ @hapi/h2o2@9.0.1
│ └─┬ @hapi/joi@16.1.7 invalid
│   └── UNMET DEPENDENCY @hapi/formula@^1.2.0
└─┬ @hapi/joi@17.1.0
  └── @hapi/formula@2.0.0 

For more info, I did upgrade node js & updated hapi modules to latest stable .

Can you help now ?

Marsup commented 4 years ago

I'm surprised it didn't help you, I mean it's all written right there :joy: h2o2 9.0.1 should have a joi 17 which in turn should have a formula 2. I don't know what you did but you have to reinstall your deps properly.

pgangwani commented 4 years ago

@Marsup hehe, yes I can relate your feeling. 😂 Bdw its resolved by deleting node_module & lock file and then `yarn install