aws-amplify / aws-amplify/amplify-cli
Switching between Linux and Windows causes errors on `amplify add auth`
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Before opening, please confirm:
- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
### How did you install the Amplify CLI?
_No response_
### If applicable, what version of Node.js are you using?
_No response_
### Amplify CLI Version
10.4.1
### What operating system are you using?
Windows
### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
### Amplify Categories
auth
### Amplify Commands
add
### Describe the bug
When pulling an Amplify backend using WSL and switching to powershell causes errors when adding auth.
Powershell version: 7
WSL Version: Ubuntu 20.04
Error:
```
TypeError: Cannot read property 'substring' of undefined
at new NodeError (internal/errors.js:322:7)
at validateString (internal/validators.js:124:11)
at Object.join (path.js:424:7)
at new AuthInputState (C:\snapshot\repo\build\node_modules\@aws-amplify\amplify-category-auth\lib\provider-utils\awscloudformation\auth-inputs-manager\auth-input-state.js:55:91)
at externalAuthEnable (C:\snapshot\repo\build\node_modules\@aws-amplify\amplify-category-auth\lib\index.js:148:26)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async C:\snapshot\repo\build\node_modules\amplify-category-analytics\lib\provider-utils\awscloudformation\service-walkthroughs\pinpoint-walkthrough.js:137:11
at async Object.executeAmplifyCommand (C:\snapshot\repo\build\node_modules\amplify-category-analytics\lib\index.js:202:3)
at async executePluginModuleCommand (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:142:5)
at async executeCommand (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:40:9)
at async Object.run (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\index.js:153:5
```
Note: When using just WSL works as expected.
Using pure powershell works as expected
### Expected behavior
have consistent behaviour across platforms
### Reproduction steps
1. Pull a Amplify app to new folder using amplify headless pull and WSL
2. open powershell
3. amplify add auth
```
Do you want to use the default authentication and security configuration? Default configuration
What do you want to do? Apply default configuration with Social Provider (Federation)
What domain name prefix do you want to use? auth112473877cc71-3877cc71
Enter your redirect signin URI: http://localhost:3000/
? Do you want to add another redirect signin URI No
Enter your redirect signout URI: http://localhost:3000/
? Do you want to add another redirect signout URI No
Select the identity providers you want to configure for your user pool: Facebook
You've opted to allow users to authenticate via Facebook. If you haven't already, you'll need to go to https://developers.facebook.com and create an App ID.
Enter your Facebook App ID for your OAuth flow:
Enter your Facebook App Secret for your OAuth flow:
```
Observe error
### GraphQL schema(s)
```graphql
# Put schemas below this line
```
### Project Identifier
_No response_
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
Contributor guide
Research direction
Start with the `amplify add auth` flow and the `auth-input-state.js` location shown in the stack trace. Reproduce the sequence by pulling with WSL, switching to PowerShell, and adding auth, then compare the generated project state and path handling; done means the command behaves consistently across both environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, powershell, typescript, ubuntu
- Domain
- authentication, cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100