NG6-starter icon indicating copy to clipboard operation
NG6-starter copied to clipboard

Gulp build on jspm branch fails

Open seangwright opened this issue 9 years ago • 5 comments

When I run gulp build on the jspm branch the build task fails. I don't know enough yet about jspm to understand if this is an issue with the gulp task.

From what I can see, the bundling process is looking for common/common.js file in the wrong location (not relative to app folder).

    $ gulp build
[13:10:11] Using gulpfile c:\dev\tutorials\NG6-starter\Gulpfile.js
[13:10:11] Starting 'build'...
[13:10:12] 'build' errored after 1.27 s
[13:10:12] Error: Error loading "common/common" at file:c:/dev/tutorials/NG6-starter/common/common.js
Error loading "common/common" from "client\app\app" at file:c:/dev/tutorials/NG6-starter/client/app/app.js
ENOENT, open 'c:\dev\tutorials\NG6-starter\common\common.js'
    at Error (native)

seangwright avatar Aug 04 '15 17:08 seangwright

+1 I tried messing around with baseUrl and lib paths but that messed things up even further. I think this has to do with potentially the expression that's passed in to bundleSFX

var resolveTo = function(resolvePath) {
    return function(glob) {
        glob = glob || '';
        return path.join(root, resolvePath, glob);
    }
};

var resolveToApp = resolveTo('app'); // app/{glob}

return jspm.bundleSFX(resolveToApp('app'), dist, {})

Replacing the first param to just 'client/app/app' fixes this problem (which is strange because shouldn't that be the exact same as what resolveToApp is doing? I'm thinking that this could be an issue with system.js bundler not being able to handle paths correctly?

Anyways, bundling works after this change but there's then an error with CSS imports and the CSS plugin

MikeJoyce19 avatar Aug 11 '15 14:08 MikeJoyce19

Thanks for filing the issue guys. I'll take a look at this as soon as I get a chance. @MikeJoyce19 do you mind opening another issue for the css error you are getting?

danthareja avatar Aug 11 '15 16:08 danthareja

I've also posed this question in the systemjs gitter. I'll link to an issue or response if one is created.

MikeJoyce19 avatar Aug 11 '15 16:08 MikeJoyce19

FYI, I was experiencing the same issue here. My pull request, #52, has been merged and should take care of it... it has for me anyway :smile:

Can anyone else confirm?

EranSch avatar Oct 19 '15 11:10 EranSch

I was getting a similar error:

Using gulpfile ~/Sites/NG6-starter/Gulpfile.js
Starting 'build'...
'build' errored after 895 ms
Error on translate for app/app.js at file:///Users/kimturley/Sites/NG6-starter/client/app/app.js
    Error: ENOENT, open '/Users/kimturley/Sites/NG6-starter/client/jspm_packages/npm/[email protected]'
    at Error (native)
    Error loading file:///Users/kimturley/Sites/NG6-starter/client/jspm_packages/npm/[email protected]

I fixed by running this command first:

jspm install

kmturley avatar Nov 24 '15 21:11 kmturley