aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 819 forks source link

Question about amplify pull parameters #13344

Closed jeremymtx closed 8 months ago

jeremymtx commented 11 months ago

Amplify CLI Version

12.7.0

Question

I am trying to pull my app into a non-OneDrive folder as suggested in 13336. However, the pull failed. Here is the output:

PS C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner> amplify pull --appId d1pej0nhgss3ma --envName dev Opening link: https://us-east-1.admin.amplifyapp.com/admin/d1pej0nhgss3ma/dev/verify/?loginVersion=1 ⠦ Confirm login in the browser or manually paste in your CLI login key: Successfully received Amplify Studio tokens. Amplify AppID found: d1pej0nhgss3ma. Amplify App name is: jpmeventplanner Backend environment dev found in Amplify Console app: jpmeventplanner ? Choose your default editor: Visual Studio Code √ Choose the type of app that you're building · javascript Please tell us about your project ? What javascript framework are you using vue ? Source Directory Path: C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\src ? Distribution Directory Path: dist ? Build Command: npm.cmd run-script build ? Start Command: npm.cmd run-script serve 🛑 Failed to pull the backend.

Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Session Identifier: 9ca0fc3d-88d5-4183-a89a-188c953d03d5

I'm not sure whether what I entered for Distribution Directory Path, Build Command, and Start Command were correct. I just took the suggested defaults even though I had been executing "npm run dev" in the app's previous OneDrive location. I went to the troubleshooting link, but the only help there about pull was about failures with a large number of UI components. That's not my problem.

Any thoughts about this would be appreciated. Thanks.

ykethan commented 11 months ago

Hey @jeremymtx, thank you for reaching out. Could you run the pull command with the --debug and provide us the output? are you pulling the backend in a empty folder or into a directory containing a framework?

jeremymtx commented 11 months ago

Here it is with --debug:

PS C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner> amplify pull --debug --appId d1pej0nhgss3ma --envName dev Opening link: https://us-east-1.admin.amplifyapp.com/admin/d1pej0nhgss3ma/dev/verify/?loginVersion=1 ⠼ Confirm login in the browser or manually paste in your CLI login key: Successfully received Amplify Studio tokens. Amplify AppID found: d1pej0nhgss3ma. Amplify App name is: jpmeventplanner Backend environment dev found in Amplify Console app: jpmeventplanner ? Choose your default editor: Visual Studio Code √ Choose the type of app that you're building · javascript Please tell us about your project ? What javascript framework are you using vue ? Source Directory Path: C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\src ? Distribution Directory Path: dist ? Build Command: npm.cmd run-script build ? Start Command: npm.cmd run-script serve 🛑 Failed to pull the backend.

Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

PullBackendFault: Failed to pull the backend. at attachBackend (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\attach-backend.js:55:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\commands\pull.js:64:9) at async Object.executeAmplifyCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\index.js:194:9) at async executePluginModuleCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:139:5) at async executeCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:37:9) at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\index.js:121:5)

C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\src contains invalid WIN32 path characters. Error: C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\src contains invalid WIN32 path characters. at Object.mkdirsSync (C:\snapshot\amplify-cli\build\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:18:22) at generateAWSExportsFile (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\amplify-frontend-javascript\lib\frontend-config-creator.js:318:6) at createAWSExports (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\amplify-frontend-javascript\lib\frontend-config-creator.js:151:9) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.createFrontendConfigs (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\amplify-frontend-javascript\index.js:49:10) at async AmplifyToolkit.onCategoryOutputsChange (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\extensions\amplify-helpers\on-category-outputs-change.js:49:9) at async generateFiles (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\attach-backend-steps\a40-generateFiles.js:63:5) at async attachBackend (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\attach-backend.js:49:9) at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\commands\pull.js:64:9) at async Object.executeAmplifyCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\index.js:194:9) at async executePluginModuleCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:139:5) at async executeCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:37:9) at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cli-internal\lib\index.js:121:5)

Session Identifier: 31c196ce-0093-4958-94c7-a16cc6e73a89 PS C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner>

PS C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner> dir

Directory: C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner

Mode LastWriteTime Length Name


d---- 10/18/2023 12:56 PM .vscode d---- 10/18/2023 12:50 PM node_modules d---- 10/18/2023 12:48 PM public d---- 10/18/2023 12:48 PM src -a--- 10/13/2023 2:53 PM 40 .browserslistrc -a--- 10/13/2023 2:53 PM 121 .editorconfig -a--- 10/13/2023 2:53 PM 142 .eslintrc.js -a--- 10/18/2023 4:02 PM 687 .gitignore -a--- 10/13/2023 2:53 PM 332 index.html -a--- 10/13/2023 2:53 PM 279 jsconfig.json -a--- 10/18/2023 12:49 PM 86058 package-lock.json -a--- 10/18/2023 12:48 PM 642 package.json -a--- 10/13/2023 2:53 PM 562 README.md -a--- 10/13/2023 2:53 PM 1038 vite.config.js

PS C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner> dir src

Directory: C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\src

Mode LastWriteTime Length Name


d---- 10/18/2023 12:48 PM assets d---- 10/18/2023 12:48 PM components d---- 10/18/2023 12:48 PM layouts d---- 10/18/2023 12:48 PM plugins d---- 10/18/2023 12:48 PM router d---- 10/18/2023 12:48 PM styles d---- 10/18/2023 12:48 PM views -a--- 10/13/2023 2:53 PM 72 App.vue -a--- 10/13/2023 2:53 PM 299 main.js

Prior to running the pull, I had executed the command npm create vuetify and then npm install. I thought this created the vue framework.

jeremymtx commented 11 months ago

Seeing the contains invalid WIN32 path characters in the exception above, I re-ran the command with the C: removed in the source directory path and had the output below. Maybe it's okay now? I am not sure if I need to pay attention to the Not pulling components...not configured with the "react" framework. It's not set up with react.

PS C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner> amplify pull --debug --appId d1pej0nhgss3ma --envName dev Opening link: https://us-east-1.admin.amplifyapp.com/admin/d1pej0nhgss3ma/dev/verify/?loginVersion=1 ⠹ Confirm login in the browser or manually paste in your CLI login key: Successfully received Amplify Studio tokens.
Amplify AppID found: d1pej0nhgss3ma. Amplify App name is: jpmeventplanner Backend environment dev found in Amplify Console app: jpmeventplanner ? Choose your default editor: Visual Studio Code √ Choose the type of app that you're building · javascript Please tell us about your project ? What javascript framework are you using vue ? Source Directory Path: \programming\aws\workshops\serverlessWebApp\jpm-event-planner\src ? Distribution Directory Path: dist ? Build Command: npm.cmd run-script build ? Start Command: npm.cmd run-script serve Not pulling components because this project is not configured with the "react" framework. ? Do you plan on modifying this backend? Yes \ Fetching updates to backend environment: dev from the cloud.Overrides functionality is not implemented for this category / Fetching updates to backend environment: dev from the cloud.⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): Event: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.

Edit your schema at C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\amplify\backend\api\jpmeventplanner\schema.graphql or place .graphql files in a directory at C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner\amplify\backend\api\jpmeventplanner\schema √ Successfully pulled backend environment dev from the cloud. Browserslist: caniuse-lite is outdated. Please run: npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme

✅ Successfully pulled backend environment dev from the cloud. Run 'amplify pull' to sync future upstream changes.

Not pulling components because this project is not configured with the "react" framework. PS C:\programming\aws\workshops\serverlessWebApp\jpm-event-planner>

ykethan commented 11 months ago

Hey @jeremymtx, if you are running the command in the root of the directory that has your framework configured, you can just pass in src without the full path. looking at the dir output and path it appears you have a vue app with src folder present. additionally, you can run amplify configure project and modify the project information.

josefaidt commented 8 months ago

Closing due to inactivity

github-actions[bot] commented 8 months ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.