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"))
);

Related Query

More Query from same tag