Apollo-server: After upgrading to apollo-server-hapi from 1.3.6 to 2.0.7 got error invalid plugin options

Created on 16 Sep 2018  路  4Comments  路  Source: apollographql/apollo-server

Upgrading to apollo-server-hapi from 1.3.6 to 2.0.7.

Expected: No issue because of the backward compatible feature of 2.0.7.

Actual: After got error invalid plugin options

{ AssertionError [ERR_ASSERTION]: Invalid plugin options {
"plugin": {
"options": {
"path": "/graphql",
"graphqlOptions": "[request => ({\r\n schema: graphqlSchema,\r\n context: request // hapi request\r\n })]",
"route": {
"auth": "firebase",
"cors": true
}
},
"register" [1]: -- missing --
}
}

[1] "register" is required
at Object.exports.apply (/Users/backend/node_modules/hapi/lib/config.js:22:10)
at internals.Server.register (/Users/backend/node_modules/hapi/lib/server.js:392:31)
at internals.applyStrategy (/Users//backend/server/auth.js:46:16)
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
generatedMessage: false,
name: 'AssertionError [ERR_ASSERTION]',
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '==' }

Most helpful comment

Did you solve this issue? I am getting the same error

All 4 comments

Did you solve this issue? I am getting the same error

@maimike could you indicate if (and possibly how) you did you resolve this issue?

Hey! Did you find any solution at last? I am stuck in that issue.

Yes, my only solution so far is to ... not upgrade. Apollo's helper page for middleware in 2.0 is not helpful.

Was this page helpful?
0 / 5 - 0 ratings