Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build frontend #56

Closed
cartoonist opened this issue Jun 21, 2018 · 4 comments
Closed

Cannot build frontend #56

cartoonist opened this issue Jun 21, 2018 · 4 comments
Assignees

Comments

@cartoonist
Copy link

cartoonist commented Jun 21, 2018

I have successfully set up the backend. But I could not build the frontend. I followed the instructions in the README file, but no success. I get dist directory list of files at http://localhost:8080.

As far as I understand, the issue is related to gulp since it produces dist directory without any html file. Also, the scripts and styles directories are empty:

dist
├── apple-touch-icon.png
├── favicon.ico
├── fonts
│   ├── glyphicons-halflings-regular.eot
│   ├── glyphicons-halflings-regular.svg
│   ├── glyphicons-halflings-regular.ttf
│   ├── glyphicons-halflings-regular.woff
│   └── glyphicons-halflings-regular.woff2
├── images
│   └── logo.png
├── robots.txt
├── scripts
└── styles

I am not familiar with "gulp.js". Do you have any idea why it does not build the frontend?

@cartoonist
Copy link
Author

I should add that my node version is v8.11.1.

@cartoonist
Copy link
Author

This patch fixed the issue (I really don't know why, but it works):

diff --git a/frontend/gulpfile.js b/frontend/gulpfile.js
index c4c9ca8..6629fed 100644
--- a/frontend/gulpfile.js
+++ b/frontend/gulpfile.js
@@ -43,13 +43,13 @@ gulp.task('scripts', () => {
     })
     .bundle()
     .pipe(source(entry.substr(entry.lastIndexOf('/') + 1)))
+    .pipe(buffer())
     .pipe(rename({
       extname: '.bundle.js',
     }))
     .pipe($.plumber())
     // .pipe($.sourcemaps.init())
     // .pipe($.babel())
-    .pipe(buffer())
     .pipe($.sourcemaps.init({ loadMaps: true }))
     .pipe($.sourcemaps.write('.'))
     .pipe(gulp.dest('.tmp/scripts'))

@cartoonist cartoonist changed the title gulp generates empty dist directory Cannot build frontend Jun 25, 2018
adamnovak added a commit to adamnovak/sequenceTubeMap that referenced this issue Jun 26, 2018
@adamnovak
Copy link
Member

Hm. It works for me on on Linux on Node 6.5.0:

[anovak@courtyard frontend]$ git checkout upstream/master
Note: checking out 'upstream/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 8662ed1 make compatible with vg version v1.7.0-103-gf87f178
[anovak@courtyard frontend]$ rm -Rf dist
[anovak@courtyard frontend]$ node_modules/gulp/bin/gulp.js
[11:27:39] Using gulpfile ~/build/sequenceTubeMap/frontend/gulpfile.js
[11:27:39] Starting 'default'...
[11:27:39] Starting 'clean'...
[11:27:39] Starting 'wiredep'...
[11:27:39] Finished 'wiredep' after 18 ms
[11:27:39] Finished 'clean' after 123 ms
[11:27:39] Starting 'lint'...
[11:27:39] Starting 'styles'...
[11:27:40] Starting 'scripts'...
[11:27:40] Starting 'images'...
[11:27:40] Starting 'fonts'...
[11:27:40] Starting 'extras'...
[11:27:40] Starting 'copyStuff'...
[11:27:40] Finished 'copyStuff' after 2.65 ms
[11:27:45] Finished 'lint' after 5.88 s
[11:27:45] Finished 'images' after 5.03 s
[11:27:45] Finished 'styles' after 5.64 s
[11:27:51] Finished 'extras' after 11 s
[11:27:51] Finished 'fonts' after 11 s
[11:27:51] Finished 'scripts' after 11 s
[11:27:51] Starting 'html'...
[11:27:57] Finished 'html' after 5.91 s
[11:27:57] Starting 'build'...
[11:27:57] build all files 251.7 kB (gzipped)
[11:27:57] Finished 'build' after 186 ms
[11:27:57] Finished 'default' after 18 s
[anovak@courtyard frontend]$ ls dist
apple-touch-icon.png  examples.html  favicon.ico  fonts  images  index.html  robots.txt  scripts  styles

But for another person in our lab on Mac we see the problem you are describing, on Node 7.0.0. Your patch seems to solve it there as well.

How did you decide to move that particular line there?

@ghost ghost assigned adamnovak Jun 26, 2018
@ghost ghost added the in progress label Jun 26, 2018
adamnovak added a commit that referenced this issue Jun 26, 2018
@ghost ghost removed the in progress label Jun 26, 2018
@cartoonist
Copy link
Author

cartoonist commented Jun 27, 2018

I have zero knowledge about gulp. So, I don't know why it exactly fixes the issue. :) In fact, I used gulp-debug to find the problematic task and line in gulpfile.js. Then, searched for some sample code to re-write task scripts to "browserify" main.js and write main.bundle.js. The sample code worked. Then, I compared it with the original scripts task and figured it out the only effective difference is the order of this line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants