AWS Amplify cannot recognize new added file - aws-amplify

New to Amplify. Following the tutorial on AWS and everything looks good.
Now I want to add a simple html file, called abc.html, just some basic html code for a test. But when I try to visit the url: https://www.yourdomain.com/abc.html, it redirects the url to https://www.yourdomain.com/abc/. So it basically doesn't recognize there is a file called abc.html. How can I add new files to Amplify?
From Amplify console, everything looks OK. It responded to the git push. Provision, build, deploy, verify are all green. It just can't recognize the new added file. Any suggestions?

I figure out the problem. Post it here in case people have the same problem.
It's a bug in Amplify web framework. If you access the file before the branch gets built and deployed, the web framework can't find the file. So it will show 404 page and record the url as 404. Later, even if you build and deploy the file through Amplify, the web framework still remembers the 404 response to the specific url. It won't refresh. That's why if you add a html file to the repo and access it before Amplify finishes deployment, the file is forever treated as not exist.

Related

Uncaught SyntaxError: Unexpected token '<' - after deploying my react redux application using Firebase

I recently used Google's Firebase to deploy my application. But somehow something is going wrong. Please access the below link to view the exact error trace.
In my build, everything looks normal all the CSS files and JS files have the appropriate code but after the deployment all the Files have HTML, go through the Below URL and watch the console to have a better idea of the error.
https://workout-wfh.web.app/
View both Images to view the difference :
1. In the deployed application
In my local build
If you view the source of the deployed website, you'll see that the <script> tag is trying to load this URL:
https://workout-wfh.web.app/MohanVarma1965/workout.git/static/js/main.5cca3537.chunk.js
which doesn't exist and so is falling back to your default HTML content. It looks like your build process is generating absolute URLs that include your username and directory path. You should adjust your build tooling to leave out everything before /js.

CSS not working when deploying a Jekyll site

I just installed Jekyll and generated a new site and modified almost nothing of the default configuration.
I can serve it well locally.
But when I push the source code to Github Pages or deploy it on Gitlab with a build script, I have the same result: the CSS doesn't load.
I haven't changed anything in the layout. I thought this would be the kind of feature that should work by default.
The repo:
https://github.com/bmrejen/jekyll_blog
The Github Pages:
https://bmrejen.github.io/jekyll_blog/
It says
"Could not find the original style sheet."
Try to add this in jekyll_blog/_config.yml
baseurl: /PROJECT
url: http://USERNAME.github.io
I saw in your history you deleted the URL & baseurl and insert it wrong.
If you still can't understand how to insert, you can watch this tutorial, it's cover it:
Hosting on Github Pages

my NativeScript app dosent display the google maps

here is my code :
https://github.com/jonny720/do-here-client/tree/master/do-here
i took the map component code from here :
https://github.com/dapriett/nativescript-google-maps-sdk/tree/master/ng-demo/app/map
the map component should display the google maps but nothing is shown.
*i installed google maps sdk, and setup the api key in the android platform.
its the first time i'm working with api in my app.
can someone light my eyes and tell me what is the problem?
The api key is missing and you should register custom element in main.ts file, and the 2 files to copy from the nativescript-google-map module were missing from your app folder
and as well as the key too.
I forked your repo and update the app, also created a .gitignore file to exclude unnecessary files and folder from repo.
I tested and it works fine.
You will have to update these files with your appropriate Google API key
> do-here/app/main.ts
> do-here/app/App_Resources/Android/values/nativescript_google_maps_api.xml
> do-here/app/App_Resources/Android/src/main/res/values/nativescript_google_maps_api.xml
and update this file to redirect all unauthorized access back to login page, changed it to test the map page
do-here/app/#shared/services/auth-guard.service.ts
ok first thank you a lot KielSoft
i solved it by typing in the cli :
tns tun android --clean

How to handle path on azure for XmlDocumentationProvider

I am using azure for deployment of my new Web API's, I am new with deployment on IIS and azure.
I have added my Web API's on azure as web application, and it's working fine, till I added documentation for each API's functions. After adding description I uncomment line below from HelpPageConfig.cs.
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
It's working finr locally, and I am able to see all descriptions, but when I published it on azure, I am getting error saying,
Could not find a part of the path 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.
site url : http://mejodo.azurewebsites.net/
Do I need to change path ?
File is already created in my system on D:\home\site\wwwroot\App_Data directory.
What changes I need to do to make it work ?
I had the same issue. For me the file was generated. Please follow the below steps.
Click on show all files in solution explorer.
Check whether you have a file in App_Data folder
If you have the file, right click and include the same in your project.
Now build and publish to Azure.
I hope this will work. Thanks
In my case XmlDocument.xml had to be added in Visual Studio to the App_Data folder within the solution using 'add existing item'.
Just add to your project new folder "App_Data" with XmlDocument.xml and publish
When you say that you have Web API's on azure as web application, do you mean that they are applications under the site ? If yes, then I think you are missing the application name in the path to the XML file.
Try going to mejodo.scm.azurewebsites.net > debug console > powershell to see the exact folder structure....
You must verify that the line in the HelpPageConfig.cs file in the Area>HelpPage>App_Start folder.
that is in the register method, this line is
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
this uncommented
then you must verify that in the project configuration, in the build XML documentation file, this is the same path as the above mentioned line.
When you publish the xml file goes in the bin folder, so change 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.
to
'D:\home\site\wwwroot\bin\XmlDocument.xml'.
and it should work.

Alfresco: Backup and Restore Issue

I followed Backup and restore method in alfresco share instead of import/export. It is now working as i expected in new Alfresco, i can see the content in sites, can view files in site document library, can view events, workflow,users,groups and so on. Everything goes fine except that the repository is not loading, but When i search for files in repository it is showing "3 result(s) found in Quality site."...but it is not displaying those files.
In my old Alfresco i have set permissions for folders in repository...will it cause any error to load repository in my new alfresco?
It shows following error when i close my server...
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
Kindly look into my issue and give some suggestion......
that error means that the log4j tries to log something in the log file of the webapp but Tomcat already shut down. have you sufficient/right permissions on the new restored alfresco installation?
If you followed correctly the backup/restore procedure from the wiki, the permissions on nodes of the repository also come together. But, if you want to reset and rebuild all the permission, you could perform a FULL reindex with the string appended to alfresco.global.properties:
index.recovery.mode=FULL

Resources