const Joi = require('@hapi/joi');
node_modules/@hapi/joi/lib/types/object/index.js:254
!pattern.schema._validate(key, state, { ...options, abortEarly:true }).errors) {
^^^
SyntaxError: Unexpected token ...
successful require
+1
Node 6 is not supported. You have 3 options:
Thanks for the reply @hueniverse ,v15.0.0 worked fine with node v6.9.1 , am I mistaken to think so ? can you direct me to a resource so I can check what features would not work with v15.0.0 as for my use case it works fine. for now I have updated my package.json with exact version I would want want to know if my app can break with v15.0.0 on node v6.9.1
I don't know. Not supporting it means exactly that. You are free to experiment and try to figure out why it is no longer working.
@rjdp https://github.com/hapijs/joi/compare/v15.0.0...v15.0.1#diff-3063cd3662b8c3bd5de2439f2ef8ee68R254 is likely the change that broke you in node 6.
+1
Same error with
node 10.13.0
joi 15.0.3
I believe I solved this by uploading node with the latest version.
I believe I solved this by uploading node with the latest version.
As was advised in @hueniverse's reply.
Same error with node 10.13.0
Node supports object spreading since 8.6, that's highly unlikely.
@Marsup
I am using joi in connection with cra.
The only solution for me was to replace '@hapi/joi' with 'joi-browser'.
'joi' did not work also, because of https://github.com/hapijs/hoek/issues/207
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.