spring-attic / tut-react-and-spring-data-rest

React.js and Spring Data REST :: A tutorial based on the 5-part blog series by Greg Turnquist
https://spring.io/guides/tutorials/react-and-spring-data-rest
883 stars 1.58k forks source link

bundle.js is not loaded, error 302 #104

Closed IngilevichV closed 5 years ago

IngilevichV commented 5 years ago

In my login.html page I have specifed the div with id "react":

<div id="react"/>

The file bundle.js is generated correctly, but when the page login.html loads, it cannot load the script bundle.js, and I always get the error 302.

Carpathea commented 5 years ago

I get a 404 on the bundle.js

gregturn commented 5 years ago

Simply put, anything found in src/main/resources/static gets copied into target/classes/static, from where it will be served up by Spring Boot.

For this tutorial, I have webpack building src/main/resources/static/built/bundle.js (that let's me flag built as a folder for git to ignore). To load it, I have to do this:

<script src="built/bundle.js"></script>

You need to run ./mvnw package and verify the path to your bundle.js in the target folder. Without more details about your setup, not sure I can help you.

gregturn commented 5 years ago

Feel free to reopen if this issue continues to plague you.