Categories
Mastering Development

Error 401 while reloading Jwt secured spring Boot React app (and configuration problems)

I’m learning spring boot and react. I have successfully learnt how to use the frontend maven plugin to combine the two. Also JWT kind of works (at least an api call returns what I want while the token is alive and returns error when i set quick expiration time). But react routes work weirdly. I […]

Categories
Mastering Development

My react app on heroku opens home page but will not open other pages

My react app runs fine locally, and deploys to heroku. However, from the home page, any link to another page shows a blank page with ‘not found’ on it. There are no other error messages. Here is my server-side package.json file: { “name”: “portfolio-generator”, “version”: “1.0.0”, “description”: “”, “main”: “server.js”, “engines”: { “node”: “12.16.x” }, […]

Categories
Mastering Development

npm start does nothing on windows

When I try to run npm start just after creating application with npx create-react-app, it does anything and exits with code 0. When I try to execute npm start command, I get the following message: C:\projects\novo-curriculo\ui>npm start > novo-curriculo-ui@0.1.0 start C:\projects\novo-curriculo\ui > react-scripts start When I enable –verbose options, I receive the following logs, which […]

Categories
Mastering Development

Making changes to app after deploy to heroku and running npm build

I deployed my REACT application to Heroku and everything works fine but how do I run it locally and make changes? when I use npm start it boots up on port 8080 (which was the port I was told to use by a tutorial) but not on 3000. When I got to localhost:8080 my website […]

Categories
Mastering Development

How to allow import meta?

I am using ES modules in my Express backend to allow for module imports. I have replaced __dirname with: const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); Server itself is up and running, however when I try to build the app, the process crashes with: ./src/server/server.js SyntaxError: C:\Projects\lore_hunters\src\server\server.js: Support for the experimental syntax ‘importMeta’ isn’t […]

Categories
Development

Axios post request fails to use proxy

I’m currently testing out the endpoints on my server via a React client using Axios. I have a proxy (http://localhost:8080) set up in my package.JSON for my client. All my GET requests are successful. My POST requests on the other-hand all fail to make use of the proxy provided in package.JSON, instead, it’s using (http://localhost:3000). […]

Categories
Development

Could not complete “npm run deploy” command for React to use on Github Pages

I’m trying to deploy a website on Github pages, and the project was created using create-react-app and has gh-pages module installed. All of my local and remote repositories are up to date, and using npm start launches the page on local host with no issues. However when I try to deploy this site to Github […]