I got very small issues when I had a side project as usual.
I think I am still not so skillful to use modern javascript, ES6 in my project.
I have used ES6 syntax in very limited cases, such as arrow function, restructuring assignment, backtick, rest parameter, and etc.)
I have not any errors when I am using the “require” method because requires is embedded syntax in node.js itself, so there is no trans compiling issue.
I changed these codes with modern JS, you can see the entire process setting in here
I have errors when I use modern JS, though.
all codes are working well except line 11.
I deeply considered why 500 errors occurred that the server-side can not process the request from the client-side whereas the client sends the request well.
I finally found the reason here, the export file, routes/index.js can not send googleMapsClient object when the “route” function exported.
At first, I insert the “googleMapsClient” variable in each router but this way reduces the readability of the codes.
You see below:
I have not solved better ways than the above one.
If anyone has feedback, please leave comments.
Thanks
Ryan
Reference