You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

遵循Graphcool TypeScript教程时遇‘Project not found: my-app@dev’错误求助

Troubleshooting "Project not found: 'my-app@dev'" Error in Graphcool Local Setup

Hey there, let's break down why you're hitting this error even after following the tutorial closely.

First, let's look at the clues you provided:

  • The error says Project not found: 'my-app@dev'
  • Your graphcool info output shows your service is named my-app dev (with a space) and runs on the local cluster, with endpoint http://localhost:60000/my-app/dev

What's causing the issue?

The problem comes down to how Graphcool identifies projects. The expected format for a project ID is [service-name]@[cluster-name]. In your case:

  • Your service name has a space (my-app dev) which can cause parsing issues
  • The error is looking for my-app@dev, but your cluster is actually local, not dev

Step-by-step fixes

1. Rename your service to remove spaces (and align with expected format)

Spaces in service names can throw off Graphcool's project ID matching. Let's rename it to something clean:

graphcool rename my-app-dev --cluster local

2. Update your endpoint in the GraphQLServer code

After renaming, run graphcool info again—your endpoint should now be http://localhost:60000/my-app-dev/dev. Update your code to match:

const server = new GraphQLServer({
  typeDefs: './src/schema.graphql',
  resolvers,
  context: req => ({
    ...req,
    db: new Graphcool({
      endpoint: 'http://localhost:60000/my-app-dev/dev',
      secret: 'mysecret123',
    }),
  }),
})

3. (Optional) Explicitly set the project ID

If you still run into issues, some versions of the Graphcool SDK require explicitly passing the projectId parameter. Use the format [new-service-name]@local:

db: new Graphcool({
  endpoint: 'http://localhost:60000/my-app-dev/dev',
  secret: 'mysecret123',
  projectId: 'my-app-dev@local',
}),

4. Restart your local Graphcool service

Sometimes changes don't take effect until you restart the service:

graphcool stop
graphcool start

Why this works

The tutorial uses my-app@dev assuming a dev cluster, but your local setup uses the local cluster. Plus, the space in your original service name made it impossible for Graphcool to correctly map to your project. By renaming and aligning the identifiers, you'll fix the mismatch that's causing the error.

内容的提问来源于stack exchange,提问作者Niks

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:26:40