Closed ghost closed 6 years ago
awsmobile publish
is a convenience command that carries out these steps in sequence:
awsmobile push
build command
you specified during init or by configureIf you can get the correct build contents into the build/ directory by npm run build
, then awsmobile publish
should be able to help you to automate that process if it's correctly configured.
Please run awsmobile configure project
and double check the distribution directory and build command are correctly set.
Let us know if you still see issues.
I'm good now, this was indeed an issue with the configuration on my end.
Somewhere along the line I changed from dist/
to build/
and was getting an older version with auth disabled, not the version that had just been built.
Hi,
I have a React application that uses Amplify's authenticator, in this fashion:
This works fine on the localhost server I get with
awsmobile run
. When I launch or refresh the application tab, I have to login.When I execute
awsmobile publish
, the resulting S3 & CloudFront URLs bypass authentication, instead going to the first page of my application with all API calls failing since there is noAuthorization
header.I was able to work around this by executing
npm run build
and manually copying the resultingbuild/
directory to my S3 bucket. The localhost server I get fromserve -s build
also works.The contents of the bucket are different when I run
awsmobile publish
vs.npm run build
, too, including lots ofaws*
files. So I suspect the issue is rooted somewhere in theawsmobile publish
code.