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

Description of src/main/js incomplete in Part 1 #109

Closed Michael960 closed 4 years ago

Michael960 commented 4 years ago

I tried to follow the tutorial from scratch (using STS 4). Until the first run ("Touring your REST service") there were no problems. But at the second run (at the end of "Diving into React") I ran into the following non-self-explaining error:

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:webpack (webpack build) on project react-and-spring-data-rest-basic: Failed to run task: 'webpack.js ' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

After investigating the differences between my source and the GIT source using KDiff3 for four hours, I found out that in my source, the following files were missing as the tutorial did not instruct me to create then (and also did not explain them):

After copying them from the GIT source, my source built successfully.

I think it would be helpful for many people to complete this in the tutorial as it is quite frustrating if you try to follow a tutorial and get some errors that you don't manage to get resolved. And I guess that most beginners are not able to resolve this one themselves.

Michael960 commented 4 years ago

main.css is also not described. But this does not run into a build error, it just makes the output look less beautiful. But I think that, for completeness, this should also be described.

gregturn commented 4 years ago

I originally left that out on purpose, since it was specific to the rest JS toolkit for doing REST calls, and not critical to what you did. There is a hyperlink to view the file. I had thought it would slow down the tutorial. If you think this needs to be inlined, we can entertain that.

Being part of client.js, I also left out the UriList and UriTemplate handler code for the same reason. If you decided, today, to use restangular, you could easily read this tutorial and plug that in.

Perhaps if I reworded the tutorial to emphasize that point would be better than dragging in code that wires a now defunct JS library?