Open orome opened 1 year ago
Hey @orome :wave: thanks for raising this! This appears to be a duplicate of https://github.com/aws-amplify/amplify-category-api/issues/884, can you confirm whether your project has a GraphQL API?
@josefaidt Yes, I have a GraphQL API and a REST API.
Hey @orome thanks for clarifying. Unfortunately I am only able to reproduce this when a GraphQL API is not present in the project, but I am taking a deeper look at this 🙂
Hey @orome can you try re-running the command with --debug
and post the full output here?
@josefaidt With --debug
the output is exactly the same as in the OP.
Hey @orome thanks for checking. I have a few follow-up questions to better understand the context:
amplify/mock-data
? if so can you delete it and retry?Additionally, we have a PR up to resolve this specific error, which should surface the actual error. Would you be open to verifying whether this prints a more helpful error?
gh repo clone aws-amplify/amplify-cli
gh pr checkout 12154
nvm use 14
yarn setup-dev
cd /your/project/directory
amplify-dev mock api
I have the identical error. no resolver, no amplify/mock-data, java JRE 16 installed, just REST apis, no GraphQL apis. I did check with the PR as suggested by @josefaidt Here is my output:
Failed to start API Mocking. Running cleanup tasks. MockProcessFault: Failed to start API Mocking.. Reason: No AppSync API is added to the project at APITest.start (D:\DEV\dev2\projects\uNTT\amplify-cli\packages\amplify-util-mock\lib\api\api.js:103:19) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async start (D:\DEV\dev2\projects\uNTT\amplify-cli\packages\amplify-util-mock\lib\api\index.js:11:9) at async Object.run (D:\DEV\dev2\projects\uNTT\amplify-cli\packages\amplify-util-mock\lib\commands\mock\api.js:14:9) at async Object.executeAmplifyCommand (D:\DEV\dev2\projects\uNTT\amplify-cli\packages\amplify-util-mock\lib\amplify-plugin-index.js:33:5) at async executePluginModuleCommand (D:\DEV\dev2\projects\uNTT\amplify-cli\packages\amplify-cli\lib\execution-manager.js:135:5) at async executeCommand (D:\DEV\dev2\projects\uNTT\amplify-cli\packages\amplify-cli\lib\execution-manager.js:33:9) at async Object.run (D:\DEV\dev2\projects\uNTT\amplify-cli\packages\amplify-cli\lib\index.js:117:5) { classification: 'FAULT', options: { message: 'Failed to start API Mocking.. Reason: No AppSync API is added to the project', link: 'https://docs.amplify.aws/cli/graphql/troubleshooting/' }, downstreamException: undefined, toObject: [Function (anonymous)], details: undefined, resolution: undefined, code: undefined, link: 'https://docs.amplify.aws/cli/graphql/troubleshooting/' }
Hope this helps.
Also have this problem after calling amplify mock api:
TypeError: Cannot read property 'stop' of undefined at APITest.stop (/snapshot/repo/build/node_modules/@aws-amplify/amplify-util-mock/lib/api/api.js:193:33) at APITest.start (/snapshot/repo/build/node_modules/@aws-amplify/amplify-util-mock/lib/api/api.js:156:18) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async start (/snapshot/repo/build/node_modules/@aws-amplify/amplify-util-mock/lib/api/index.js:18:5) at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/amplify-util-mock/lib/commands/mock/api.js:21:5) at async Object.executeAmplifyCommand (/snapshot/repo/build/node_modules/@aws-amplify/amplify-util-mock/lib/amplify-plugin-index.js:55:3) at async executePluginModuleCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:135:5) at async executeCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:33:9) at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:117:5)
New project with only 1 API endpoint
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v18.14.2
Amplify CLI Version
10.8.1
What operating system are you using?
macOS
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
I get:
Expected behavior
I expected the CLI to work
Reproduction steps
Project Identifier
3863987f00fb7935a93679dd30c7e0f9
Log output
No response
Additional information
No response
Before submitting, please confirm: