Mibew / mibew

Mibew Messenger - open-source live support application
https://mibew.org
Other
473 stars 204 forks source link

Question: Differences between pre-built js files and custom built #183

Closed nakupanda closed 7 years ago

nakupanda commented 7 years ago

Hi,

Thanks for the great project.

I'm having troubles when compiling js files, see below screenshots

image

Red lines are pre-built version while greens are those generated after running 'gulp js' locally, the differences apparently have led a problem:

image

Any clue to solve this problem? Thanks.

nakupanda commented 7 years ago

Have checked gulpfile.js and found below ordered files

var getClientSideApp = function(name) { var appSource = config.jsPath + '/source/' + name;

return gulp.src(appSource + '/**/*.js')
    .pipe(order(
        [
            appSource + '/init.js',
            // The following line is equivalent to
            // gulp.src([appSource + '/*.js', '!' + appSource + '/app.js']);
            appSource + '/!(app).js',
            appSource + '/models/**/base*.js',
            appSource + '/models/**/*.js',
            appSource + '/collections/**/base*.js',
            appSource + '/collections/**/*.js',
            appSource + '/model_views/**/base*.js',
            appSource + '/model_views/**/*.js',
            appSource + '/collection_views/**/base*.js',
            appSource + '/collection_views/**/*.js',
            appSource + '/regions/**/base*.js',
            appSource + '/regions/**/*.js',
            appSource + '/layouts/**/base*.js',
            appSource + '/layouts/**/*.js',
            appSource + '/**/base*.js',
            // The following line is equivalent to
            // gulp.src([appSource + '/**/*.js', '!' + appSource + '/app.js']);
            '!' + appSource + '/app.js',
            appSource + '/app.js'
        ],
        {base: process.cwd()}
    ))
    .pipe(concat(name + '_app.js'));

}

Could this be the cause or something else?

faf commented 7 years ago

to begin with, have you performed all steps from this chapter before running gulp?

nakupanda commented 7 years ago

thanks for replying, Yes I have read it few times, I also have successfully built pages using gulp.

faf commented 7 years ago

ok. and what about your environment (i.e. OS, version of node.js, etc.)?

nakupanda commented 7 years ago

OS: Ubuntu Server 14 LTS running in Virtualbox

NodeJS: v0.10.25

Gulp: CLI version 3.9.0

faf commented 7 years ago

Very odd. At the time I've been able to successfully compile js using:

  1. node.js 0.10.10 and gulp 3.8.11
  2. node.js 6.9.2 and gulp 3.8.11
  3. node.js 6.9.2 and gulp 3.9.1

What is the version of your local gulp?

nakupanda commented 7 years ago

My local gulp is version 3.8.11 and global is 3.9.0, now trying something else.

BTW have you checked all js files that generated after running 'gulp js' are running fine in browser? I have no problem too when running the command 'gulp js', js files were actually built, they just didn't work properly in browser.

faf commented 7 years ago

of course, I've tested everything after the compilation.

you could try to level up the version of your local gulp and try again. update your local repo and run npm install. (i presume) it will update your local gulp up to 3.9.1. then you can also update your global gulp.

nakupanda commented 7 years ago

Thanks for your help. I tried placing a new copy somewhere else and installed new npm packages and ran the command again it worked perfectly.

Closing this issue :)