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
import { createBuiltMeshHTTPHandler } from '../../../../.mesh'
const meshHttp = createBuiltMeshHTTPHandler()
export { meshHttp as get, meshHttp as post }
after that I can run these commands:
npm run npmbuild:mesh
npm run serve:mesh
this works well.
however, if I try to run it as serverless, since I am deploying on Vercel:
npm run dev
curl http://localhost:5173/api/graphql
I get this error:
2:18:23 AM [vite] Error when evaluating SSR module /.mesh/index.ts: failed to import "graphql"
|- SyntaxError: [vite] Named export 'GraphQLScalarTypeConfig' not found. The requested module 'graphql' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'graphql';
const {GraphQLResolveInfo, SelectionSetNode, FieldNode, GraphQLScalarTypeConfig} = pkg;
at analyzeImportedModDifference (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:54078:19)
at nodeImport (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55114:9)
at async ssrImport (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55011:24)
at async eval (/Users/roeeklinger/Github/svelteket-website/.mesh/index.ts:3:44)
at async instantiateModule (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55071:9)
2:18:23 AM [vite] Error when evaluating SSR module /Users/roeeklinger/Github/svelteket-website/src/routes/api/graphql/+server.ts: failed to import "/.mesh/index.ts"
|- SyntaxError: [vite] Named export 'GraphQLScalarTypeConfig' not found. The requested module 'graphql' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'graphql';
const {GraphQLResolveInfo, SelectionSetNode, FieldNode, GraphQLScalarTypeConfig} = pkg;
at analyzeImportedModDifference (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:54078:19)
at nodeImport (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55114:9)
at async ssrImport (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55011:24)
at async eval (/Users/roeeklinger/Github/svelteket-website/.mesh/index.ts:3:44)
at async instantiateModule (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55071:9)
SyntaxError: [vite] Named export 'GraphQLScalarTypeConfig' not found. The requested module 'graphql' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'graphql';
const {GraphQLResolveInfo, SelectionSetNode, FieldNode, GraphQLScalarTypeConfig} = pkg;
at analyzeImportedModDifference (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:54078:19)
at nodeImport (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55114:9)
at async ssrImport (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55011:24)
at async eval (/Users/roeeklinger/Github/svelteket-website/.mesh/index.ts:3:44)
at async instantiateModule (file:///Users/roeeklinger/Github/svelteket-website/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:55071:9)
Mesh can be deployed to Vercel using NextJS, and it can be deployed using Sveltekit, can I also deploy Mesh to Vercel as serverless when using Sveltekit?
The text was updated successfully, but these errors were encountered:
if this guide is followed, mesh can run well with Sveltekit:
https://the-guild.dev/graphql/mesh/docs/getting-started/deploy-mesh-gateway#mesh-and-sveltekit
package.json
src/routes/api/+server.ts
after that I can run these commands:
this works well.
however, if I try to run it as serverless, since I am deploying on Vercel:
I get this error:
Mesh can be deployed to Vercel using NextJS, and it can be deployed using Sveltekit, can I also deploy Mesh to Vercel as serverless when using Sveltekit?
The text was updated successfully, but these errors were encountered: