I have a CRA site that has been deployed to Amazon S3.
When the router paths have a / in the url the Javascript or CSS is no longer loading. (i.e. it's trying to load from example.com/subdomain/static rather than example.com/static)
I've tried setting PUBLIC_URL='/' in .env.production and that's not helping.
Any clues on how to get URLs working again.
Any
homepage was not set correctly in package.json
Related
Added sitemap.xml to the vue3 project. When calling http://127.0.0.1:5173/sitemap.xml it is showing sitemap. Also showing sitemap after creating build localhost/sitemap.xml. But in production, the site map is not loading.
Any idea why sitemap.xml not working in production. i am using AWS Amplify for production.
I kept the sitemap.xml file in root as well as in the public folder.
Hii Can anyone help me to upload the Shopware PWA on the server(Server Side Rendering). I have tried almost all the methods mentioned on the nuxt js official website but I can't upload the PWA on the server. By using yarn generate, it converts the PWA on the static website so when I changed it on the backend it doesn't reflect on the PWA(like category, pages, etc) and also doesn't change the title of the website dynamically. and I have also tried this method https://www.niagahoster.co.id/blog/upload-nuxtjs-di-hosting/ but it also doesn't work for me.
I thought we can only host Static websites onto S3 bucket.
How can React Js apps be hosted onto S3? React pages are dynamic in my understanding. The content of the page changes based on the user choices made on the page. Isn't that correct?
thank you
React pages are dynamic in my understanding.
Your definition of "dynamic" and S3's definition of "dynamic" are not the same thing.
Everything that's changing in the React application is happening in the browser. It's just the browser running JavaScript code. Nothing on S3 prevents a browser from running JavaScript code.
What they mean is that you can't have dynamic server-side content, such as a Node.js application or a PHP application.
The React application is served to the user by static HTML/JavaScript/CSS files.
React is a Single-page application (SPA) with browser -side rendering. A Single-page application (SPA) is a web application implementation that loads a web document and updates it by using JavaScript APIs in the browser. In simple terms, when a web application written in react works, the browser download the application files and run it using JavaScript on browser with the support of react libraries. Therfore the content in react app (min.js files and other assests in a production build) are not changing with time. A static storage and a public access(url) is the sufficiant to host a react application. So it can be host in a S3 bucket or github-pages or similar static storage without any computing power.
In a react webapp what's dynamic is the rendering of HTML elements using javascript. A dynamic web application refered by AWS is a one with dynamic server side rendering as Node.js. You can refer this guide to learn more on how to deploy a React application in Amazon S3.
I decided to use Scribe to make documentation of my api. So i generated the docs folder offline then i pushed it onto app platform.
Now when i load the page the page loads but the css files do not use the https protocol for the whole website.
I have tried checking on the Github repo to see if their anyother people with the same challenges but i do not seem to see that people are facing this issue.
I will be thankful for the help.
I tried to make changes of the scribe.php file in the config folder in my laravel project but it still refused.
I placed the base_url to be https:localhost before pushing but still getting the same error
we have built UI using react js framework and html +css + js code is deployed inside apache 2. When I browse website it works fine but if I refresh page then I get 404. Can someone tell me how can I fix it.
Perhaps this answer is relevant to you:
Apache web server doesn't allow me to refresh on /about but on localhost its working fine
I know I also had problems related to HTML5 mode when first setting up react-router.
If you are using React-Router you are probably having this problem: React-router urls don't work when refreshing or writting manually.
You can also see the React Router tutorial for how to set up a production Express server.