score:0
Accepted answer
uncaught syntaxerror: unexpected token '<'
main.679eafbe.chunk.js:1
this error implies your server is returning html when handling main.679eafbe.chunk.js
.
this means express.static
probably isn't matching that path and the request is passed onto your html middleware.
this is either because main.679eafbe.chunk.js
doesn't exist in the client/build directory or express.static
is misconfigured.
if i were to take a guess, i'd suggest changing the root
you pass to express.static
to align with the path you're using in the html middleware, e.g.
app.use(express.static(path.resolve(__dirname, "../client/build"))); // path.resolve was missing here
app.get("/*", (req, res) =>
res.sendfile(path.resolve(__dirname, "../client/build", "index.html"))
);
Source: stackoverflow.com
Related Query
- Blank page after deployment - React app with node
- Getting blank page after react app publish in github
- Staticfile deployment of built React app to Cloud Foundry seems to think it is a Node deployment, even with buildpack
- Got a blank white page after deploying react app to gitlab pages
- Getting blank page after deploying React app to surge.sh
- CORs error AFTER deploying React App and separate Node API to production Unbuntu server where React static files are servered with NGINX
- React app crashed with Heroku after deployment
- Create react app breaks after deployment on refresh 404 with Nginx
- React app deployment on github pages shows a blank page
- Ionic react app showing blank page after first state change
- Blank page after running build on the react app and errors on the console
- blank page after of making project by create react app
- React App showing blank page after deploy
- I Have A Problem With Deploying My React App In Github Pages, It Shows Me A Blank Page
- Deployment of react app with express server gives blank screen but the app works fine with serve -s build
- React blank page after deployment in a folder
- Why IE 11 display blank page rendering react app
- Blank page after successful Firebase deployment
- React app has to clear browser cache after new deployment
- react-router throwing 404 upon page refresh with React app hosted on GoDaddy
- How to run a React Native App with Node js Backend on Android Device?
- Create React App with an older version of node
- Using Require with React in a web page without node
- Seeing empty page after deployed to S3 with React Route
- React app showing page with "404 the requested path could not be found" when using Apache
- React Js with PWA Blank Screen White on Safari Browser at first page reload
- React website not showing after deployment with firebase
- React Redux with redux-observable use the router to navigate to a different page after async action complete
- how to run my node application and react app in the same time with one command?
- Getting blank screen in windows after electron-builder react electron app
More Query from same tag
- Why is this array undefined in React?
- Posting data by combining the data from a form and a fetch api response
- React hover/active/focus style css selector not working for enclosed element
- Update quantity of items in basket page from localStorage in react
- ERROR: Expected mock function to have been called
- How to add colSpan in ReactJS styled components?
- The tag <ReactComponent> is unrecognized in this browser
- Can Reactjs programmatically handle :before?
- Is there a better way to compose a message based on conditions?
- Is it possible to create a React Hook factory function?
- Dynamically applying CSS to JSX objects
- Custom hook not using useState() properly?
- I am trying to hide and show an element based on states but it could not worked?
- React Controlled Components not receiving inputs properly
- How to filter products by size in react redux
- How to add css to template literals in ES6 with react
- Is there a way in electron to push keyboard event?
- how to change className depending on condition while looping over a list?
- how to execute a function which is evoked in a child component as a property in react?
- React: setState value not working when refreshing the web
- How to hide scrollbar without affecting the body width using javascript?
- Aligning a text div inside another div vertically
- How to fix the console warning "The resource ... was preloaded using link preload but not used within a few seconds from the window's load event"?
- Render any child component with props from string
- React Private Routing through id
- How do I update a note in a notes app I'm working on?
- Get pathname from window and store it in state to use in fetch function
- React Router for Unauthenticated User
- Testing click event in enzyme on react functional component not passing
- React table pre select rows