aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

Bundler not working with Jspm 0.17.0-beta.22 #129

Closed Vheissu closed 7 years ago

Vheissu commented 8 years ago

I am seeing the following in my app:

[10:43:56] TypeError: Path must be a string. Received [ './jspm.browser.js', './jspm.config.js' ]
    at assertPath (path.js:7:11)
    at Object.resolve (path.js:184:7)
    at validateConfig (C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\utils.js:46:51)
    at Object.unbundle (C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\unbundle.js:42:29)
    at Gulp.<anonymous> (C:\aurelia-jspm.17-skeleton\build\tasks\bundle.js:21:18)
    at module.exports (C:\aurelia-jspm.17-skeleton\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (C:\aurelia-jspm.17-skeleton\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (C:\aurelia-jspm.17-skeleton\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (C:\aurelia-jspm.17-skeleton\node_modules\orchestrator\index.js:134:8)
    at runNextSet (C:\aurelia-jspm.17-skeleton\node_modules\run-sequence\index.js:86:16)
    at runSequence (C:\aurelia-jspm.17-skeleton\node_modules\run-sequence\index.js:97:2)
    at Gulp.<anonymous> (C:\aurelia-jspm.17-skeleton\build\tasks\build.js:47:10)
    at module.exports (C:\aurelia-jspm.17-skeleton\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (C:\aurelia-jspm.17-skeleton\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (C:\aurelia-jspm.17-skeleton\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (C:\aurelia-jspm.17-skeleton\node_modules\orchestrator\index.js:134:8)
    at C:\Users\Fathom\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Function.Module.runMain (module.js:577:11)
    at startup (node.js:160:18)
    at node.js:456:3

My bundle configuration is as follows:

var config = {
  force: true,
  baseURL: '.',
  configPath: [
    './jspm.browser.js',
    './jspm.config.js'
  ], 
  injectionConfigPath: './jspm.config.js',
  bundles: bundles.bundles
};

Even though the bundler has a check to see if it is an array, it seems to be ignored.

Vheissu commented 8 years ago

The plot thickens. If I just supply a string to configPath like it wants, so I just provide: jspm.config.js instead, I get the following error:

SystemJS.config({
^
ReferenceError: SystemJS is not defined
    at evalmachine.<anonymous>:1:1
    at Object.exports.runInContext (vm.js:44:17)
    at readConfig (C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\config-serializer.js:25:6)
    at getAppConfig (C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\config-serializer.js:37:16)
    at createBuildExpression (C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\bundler.js:53:51)
    at Object.bundle (C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\bundler.js:115:25)
    at _bundle (C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\index.js:87:18)
    at C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\index.js:58:18
    at Array.forEach (native)
    at Object.bundle (C:\aurelia-jspm.17-skeleton\node_modules\aurelia-bundler\dist\index.js:50:25)
Vheissu commented 8 years ago

Changing my configuration files to just use System. and I get a few other errors now about not being able to find dependency JSON files.

configPath: './jspm.config.js', will get the me the following error (presumably because it needs the browser config for paths):

[11:26:52] (SystemJS) Error: ENOENT: no such file or directory, open 'C:\aurelia-jspm.17-skeleton\npm:aurelia-framework@1.0.0-beta.2.0.1.json'
            at Error (native)
        Error loading C:/aurelia-jspm.17-skeleton/npm:aurelia-framework@1.0.0-beta.2.0.1.json
marinasundstrom commented 8 years ago

I'm using the same version in one of my projects. For me it fails when bundling. #132

EisenbergEffect commented 8 years ago

@robertsundstrom Can you help identify the problem?

ahmedshuhel commented 7 years ago

Should work with the latest jspm@beta. Closing this one.