Server unable to find JSON files, but finds IMG files in the same Assets folder - json

I have built a portfolio site for my first Angular project and now it is ready and I'm getting an error when my Angular project attempts to locate the JSON files, but it can find and generate the image files that are in the same assets folder and I can get the JSON when I run my project locally-
main.dad43c6….bundle.js:1 ERROR
e {headers: t, status: 404, statusText: "Not Found", url: "http://megakyle83.com/assets/json/socialMedia.json", ok: false, …}
error
:
"<HTML>
↵<HEAD>
↵<TITLE>404 Not Found</TITLE>
↵<BASE href="/error_docs/"><!--[if lte IE 6]></BASE><![endif]-->
↵</HEAD>
↵<BODY>
↵<H1>Not Found</H1>
↵The requested document was not found on this server.
↵<P>
↵<HR>
↵<ADDRESS>
↵Web Server at megakyle83.com
↵</ADDRESS>
↵</BODY>
↵</HTML>
headers
:
t {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}
message
:
"Http failure response for http://megakyle83.com/assets/json/socialMedia.json: 404 Not Found"
name
:
"HttpErrorResponse"
ok
:
false
status
:
404
statusText
:
"Not Found"
url
:
"http://megakyle83.com/assets/json/socialMedia.json"
__proto__
:
Object
When I did my build I used the terminal command ng build --prod and then uploaded the files from the generated dist folder onto my Windows Plesk Server through GoDaddy. When I look at my assets folder on the Plesk server it shows that all the files are there under assets/json/ . I have several separate JSON files in this same folder. Could that be part of the problem?
I have all my files uploaded to my github at -https://github.com/RyanIndustries8/megakyle83
I have tried everything under the sun to make this work and I'm struggling to find anyone who knows enough about Angular to get an answers.

Look at the error message, http://megakyle83.com/assets/json/socialMedia.json 404 Not Found. I've browsed your repo and there is no such a file in assets/json/ directory moreover, there is no json directory in the assets.
I couldn't find missing socialMedia.json file in your entire repo. Ensure that this file exist under path mentioned in the error message.

The issue didn't end up being my code, instead it was a setting issue in the Plesk Server. I had to go into the Server Settings and add text/json and */json to the list of usable files. Thank you for looking at this issue.

Related

AllenNLP: HEAD request failed for url with status code 404 - open information extraction

Running the training command from open information extraction demo fails with the following error message:
OSError: HEAD request failed for url https://raw.githubusercontent.com/allenai/allennlp-models/main/training_config/structured-prediction/srl.jsonnet with status code 404
Does this mean the file is removed? Where can the replacement file be found?
Looking for a replacement file I found this file from allenai repo but it seems to have required fields such as "dataset_reader" missing.
communicated the issue with allennlp and the file is now accessible at the same address.

Impossible to retrieve files from an FTP in WinSCP - Bad message

I use WinSCP 5.17 to retrieve files from an FTP, when I retrieve files from the root folder of the FTP all works, but as soon as I try to retrieve the files from the sub-folder it doesn't work.
Here is the instruction I use:
get /Clients/Folder2/Folder3/*.* F:\folder1\folder2\
and this is the error message:
Error listing directory '/Clients/Folder2/Folder3'.
Bad message (badly formatted packet or protocol incompatibility).
Error code: 5
Error message from server: Bad message
Thanks for your help.
Finally I solved the problem, I generated the script from WinSCP GUI and it works.
open ftps://username:password#ftp-adresse.azure.com/ -certificate="ee:5f:af:7c:26:6b:bb:6f:cd:86:6a:2c:03:1e:8f:ab:e7:63:fd:43" -rawsettings FollowDirectorySymlinks=1
cd /Clients/folder2/folder3
lcd "F:\folder1\folder2"
get "*.xlsx"
exit

AWS Amplify: DevTools failed to load SourceMap: Unexpected token < in JSON at position 0

I am getting several warnings when loading my website on Google Chrome similar to the following:
DevTools failed to load SourceMap: Could not parse content for https://mywebsite.com/static/js/2.abcd1234.chunk.js.map: Unexpected token < in JSON at position 0
My webapp is a React application (create-react-app) deployed on AWS Amplify. I do not get these warnings when running the app locally. How do I get rid of these warnings?
This is a problem caused by using react-router with AWS amplify. See this github issue. It suggests adding the following entry in the Rewrites and redirects section of App settings in AWS Amplify:
Source address:
</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$)([^.]+$)/>
Target address:
/index.html
Type:
200 (Rewrite)
To solve my problem, I added the map extension to this regex:
Source address:
</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map)$)([^.]+$)/>
I checked my Rewrites and redirects settings and it was already configured as per the below answer by "roob" but also had json at the end. I removed it to see if that helped. Either way, I still got the error.
More research with a colleague and found another root cause. Answered here:
AWS Amplify error: Failed to parse source map... file: Error: ENOENT: no such file or directory

400 Errors on Github Pages because of error on manifest.json being read as text/html

So I'm trying to serve my github pages website to https://dgatto.github.io/website/ and i keep getting these errors
Failed to load resource: the server responded with a status of 400 ()
manifest.json:1 Failed to load resource: the server responded with a status of 400 ()
manifest.json:1 Manifest: Line: 1, column: 1, Syntax error.
I think that the 400's are because of the "syntax error" and I'm pretty sure that the syntax error is because of the manifest.json file being read as text/html in the network tab.
My question is, how do I change the server to accept the file as json? It's github pages so I don't really have access to the server itself.
Here's the repo if that helps: https://github.com/dgatto/website
Since you are serving your Application at https://dgatto.github.io/website/, you should define it as the homepage in your package.json file and then build.

HTTP Status 404 - /alfresco/testCMISfromJS.html

I'm trying to run HTML file on Alfresco on folder (alfrescodir)/tomcat/webapps.
I try to run http://localhost:8080/alfresco/testCMISfromJS.html, but I got the error:
HTTP Status 404 - /alfresco/testCMISfromJS.html
type Status report
message /alfresco/testCMISfromJS.html
description The requested resource is not available.
How can I solve this? Please help me.
Solved it.
The files were in the wrong folder. The right folder would be: (alfrescodir)/tomcat/webapps/alfresco/ .