Unable to build and run
Closed this issue ยท 9 comments
For some reason, I'm unable to build and run on my local machine after cloning the repo. Steps to reproduce the behavior
git clone https://github.com/lukeed/colors-app
yarn
yarn run build
yarn start
When I browse to http://localhost:3000
, I get a blank page with the following error in the Chrome Console
Uncaught SyntaxError: Unexpected token < index.js
I'm on a windows 7 64-bit machine with node version v7.5.0.
Any help would be greatly appreciated and thank you for sharing the project with the community. You ๐ค
Thanks very much!
Unfortunately, I just cloned a fresh copy & reproduced your steps. Even with the same Node version, I wasn't able to get any errors. Perhaps your yarn
version has something to do with it? I'm on v0.21.3
.
Thank you for your quick response.
I'm on yarn v0.21.3 as well and to verify I tried to build using npm without any luck. I'm not sure what I'm doing wrong here. Are there any dependencies beyond the npm packages like having ruby installed on my machine?
Nope! It's pretty simple. Do you mind sharing a screenshot of your terminal after running npm run build
?
Thanks! Hmmm... after the release
sub-task, you should no longer have an index.js
file. If you check your release/js
directory, the filename should look something like: index-891ff2a18a.js
. Right?
If that's the case, then there's an issue with fly-rev.revReplace()
, because none of your asset links have been updated.
For example, after release
, my paths look like:
<link rel=stylesheet href=/css/index-9adca9217f.css>
<script defer src=/js/index-891ff2a18a.js></script>
Does npm run watch
work? That doesn't initialize the revReplace
method.
Yes the filenames in the release directory are similar to what you said above.
The other work-around I found was to launch the app from the dist
directory using http-server
.
npm run watch
works the same way I suppose, I didn't realize it until I saw your response ๐ . Thank you for your help with this.
Okay. Yes, watch
is the development task, which compiles to & serves content from /dist
. The build
task is a production release, and start
simulates a production server.
I'm going to close this issue. Although it's still very much an issue, it belong to the plugin I linked earlier.
Thanks for taking the time to help!
@modulexcite I fixed the fly-rev
package, so you should be able to run the build
task now. ๐ค๐ผ
Thank you @lukeed. I can confirm that it works now.