Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid "inert" server options issue after Hapi update to 20.2.2 : #165

Closed
yogeesh-lilly opened this issue Jul 21, 2022 · 5 comments
Closed
Labels
support Questions, discussions, and general support

Comments

@yogeesh-lilly
Copy link

[1]         const settings = Validate.attempt(server.settings.plugins?.inert ?? {}, internals.schema, 'Invalid "inert" server options');
[1]                                                                   ^
[1] 
[1] SyntaxError: Unexpected token '.'
[1]     at wrapSafe (internal/modules/cjs/loader.js:915:16)
[1]     at Module._compile (internal/modules/cjs/loader.js:963:27)
[1]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
[1]     at Module.load (internal/modules/cjs/loader.js:863:32)
[1]     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
[1]     at Module.require (internal/modules/cjs/loader.js:887:19)
[1]     at require (internal/modules/cjs/helpers.js:74:18)
[1]     at Object.<anonymous> (/Users/c305174/Projects/DIGH_LC3_CONFIGURATION_PORTAL_V2/server/config/manifest.js:1:15)
[1]     at Module._compile (internal/modules/cjs/loader.js:999:30)
[1]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Context

Node: 12.20.2
npm: 6.14.11
hapi: 20.2.2

inert: 7.0.0
What am I doing wrong?

@yogeesh-lilly yogeesh-lilly added the support Questions, discussions, and general support label Jul 21, 2022
@devinivy
Copy link
Member

That error there is because inert uses some JS syntax that requires node v14+. As of inert v7, only node v14+ is supported. Node v12 went EOL I believe in April, so it's a good time to upgrade services that are still on that version. Or if you like, you can use inert v6!

@yogeesh-lilly
Copy link
Author

Hey @devinivy thanks for reply

The issue still persist after upgrading the node to v14+

@devinivy
Copy link
Member

Interesting— this optional chaining syntax is supported in node v14: https://node.green/#ES2020-features-optional-chaining-operator-----

What is the specific version of nodejs you're using? And are you getting the exact same error, or a new one?

@devinivy devinivy reopened this Jul 22, 2022
@yogeesh-lilly
Copy link
Author

yogeesh-lilly commented Jul 26, 2022

HI @devinivy

I am getting new error:

[1] [ core ] [ server, start ] "Error is Error: Cannot set uncompiled validation rules without configuring a validator"

@devinivy
Copy link
Member

This error is unrelated to inert: check-out the "joi Schema Compiler" section in the hapi v19 release notes for more information: hapijs/hapi#4017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

2 participants