New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing aws-exports.js using typescript generates error. #222
Comments
as a reference (I don't know if it is correct or a workaround) I renamed aws-export.js to .ts and compiled it. After that no |
@superandrew that is exactly what I do for now (rename to .ts for the compiler). We are actively working on a fix for this for TS specifically in the awsmobile-cli, but what you are doing is the correct workaround for now. |
@superandrew if you don't like to change filename. Use 'require' instead of 'import' works for me. Just be aware when require you get { default } so need to get .default from require.
|
Thanks @richardzcode |
You can also just rename aws-exports.js to aws-exports.ts and import './aws-exports'; |
Still no way to generate aws-exports.ts ? We're nearly late 2019!! |
Add new file |
…y, & tint, respectively
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
According to the documentation, I should/could import the aws-exports module after downloading the proper file from mobile HUB, and then use that configuration to initialize Amplify's configuration.
However I am having many troubles doing so. To start, I need to set
"allowJs":true
in tsconfig.Then I import everything as specified in docs.
then use it
But when I do, i get this error:
Cannot write file '<path>/aws-exports.js' because it would overwrite input file.
If I dont set allowJS=true I get this error:
Am I doing something wrong? Is Amplify supposed to be configured in a typescript application, like Ionic application?
Apart from this which I am not sure if it is a bug or improper configuration, any help/link/example would be greatly appreciated.
The text was updated successfully, but these errors were encountered: