You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to deploy GraphQL Mesh on @zeit Now as a Next.js API route. No matter where I place the .meshrc.yaml, it can't be found.
[POST] /api/mesh
2020-03-27T05:53:20.824Z b1b51018-01d9-45ad-886e-1b114097e663 ERROR TypeError: Cannot read property 'require' of undefined at parseConfig (/var/task/node_modules/@graphql-mesh/runtime/dist/parse-config.js:25:16) at async module.exports.vbkO.__webpack_exports__.default (/var/task/.next/serverless/pages/api/mesh.js:283:84) at async apiResolver (/var/task/node_modules/next/dist/next-server/server/api-utils.js:48:9)
I also tried to deploy it out as a standalone function on @zeit Now and even when I could confirm the file was present, it still couldn't find the config.
[POST] /api/mesh
.meshrc.json
mesh.js
mesh.js.map
2020-03-27T14:38:38.136Z 504307a5-1c46-4f80-816d-95ea581ec08f ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: Cannot read property 'require' of undefined","reason":{"errorType":"TypeError","errorMessage":"Cannot read property 'require' of undefined","stack":["TypeError: Cannot read property 'require' of undefined"," at parseConfig (/var/task/node_modules/@graphql-mesh/runtime/dist/parse-config.js:25:16)"," at _default (/var/task/api/mesh.js:22:61)"," at Server.<anonymous> (/var/task/___now_helpers.js:869:13)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError: Cannot read property 'require' of undefined"," at process.<anonymous> (/var/runtime/index.js:35:15)"," at process.emit (events.js:323:22)"," at process.emit (/var/task/__sourcemap_support.js:2535:21)"," at processPromiseRejections (internal/process/promises.js:209:33)"," at processTicksAndRejections (internal/process/task_queues.js:98:32)"]}
Unknown application error occurred
It would be helpful for serverless scenarios to allow passing the config object into parseConfig directly. This would also enable the use of ENV_VARS for secrets, such as API Keys.
The text was updated successfully, but these errors were encountered:
Ran into the same issues getting started. Had a hard time getting parseConfig to find my config file, and then realized I wouldn't be able to use it with different environment variables. Happy to help out in any way.
I confirmed the changes made by @ardatan were good and will be releasing a write-up of how I've deployed Mesh as a gateway on Zeit Now and consumed it as a hasura remote schema later today.
I'm currently trying to deploy GraphQL Mesh on @zeit Now as a Next.js API route. No matter where I place the
.meshrc.yaml
, it can't be found.I also tried to deploy it out as a standalone function on @zeit Now and even when I could confirm the file was present, it still couldn't find the config.
It would be helpful for serverless scenarios to allow passing the config object into
parseConfig
directly. This would also enable the use of ENV_VARS for secrets, such as API Keys.The text was updated successfully, but these errors were encountered: