SpoonX / aurelia-charts

Graphs plugin for aurelia. Supports all libraries.
MIT License
12 stars 5 forks source link

Unable to find 'config.js' errors when using aurelia-cli #12

Closed hozn closed 3 years ago

hozn commented 7 years ago

I am using aurelia-cli 0.23.0.

I installed aurelia-charts (and aurelia-charts-c3) using npm and updated aurelia.json vendors.js bundle dependencies to include:

          {
            "name": "aurelia-charts",
            "path": "../node_modules/aurelia-charts/dist/amd",
            "main": "aurelia-charts",
            "resources": [
              "component/chart-element.html",
              "component/chart-picker.html",
              "component/dimensions-picker.html"
            ]
          },

However, trying to run au run yields the following error (snippet):

Tracing aurelia-charts...
{ uid: 10,
  name: 'writeBundles',
  branch: false,
  error: 
   { Error: ENOENT: no such file or directory, open '/home/hans/workspace/contact-manager/aurelia-charts/config.js'
       at Error (native)
       at Object.fs.openSync (fs.js:640:18)
       at Object.fs.readFileSync (fs.js:508:33)
       at Object.exports.readFileSync (/home/hans/workspace/contact-manager/node_modules/aurelia-cli/lib/file-system.js:49:13)
       at fileRead (/home/hans/workspace/contact-manager/node_modules/aurelia-cli/lib/build/bundled-source.js:83:31)
       at Object.context.fileRead (/home/hans/workspace/contact-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:176:18)
       at Object.context.load (/home/hans/workspace/contact-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:357:30)
       at Object.load (eval at <anonymous> (/home/hans/workspace/contact-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:9), <anonymous>:832:29)
       at Object.fetch (eval at <anonymous> (/home/hans/workspace/contact-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:9), <anonymous>:822:66)
       at Object.check (eval at <anonymous> (/home/hans/workspace/contact-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:9), <anonymous>:854:30)
     errno: -2,
     code: 'ENOENT',
     syscall: 'open',
     path: '/home/hans/workspace/contact-manager/aurelia-charts/config.js',
     moduleTree: [ 'aurelia-charts/decorator/chart' ],
     fileName: '/home/hans/workspace/contact-manager/node_modules/aurelia-charts/dist/amd/decorator/chart.js' },
RWOverdijk commented 7 years ago

@hozn Thanks for reporting this.

I'm not very familiar with aurelia-cli. But it looks like it's looking for the config in the wrong place. Perhaps @doktordirk has the answer to this question?

depeter commented 7 years ago

I was having the same issue. The reason is that in dist/amd/decorator/chart.js as wel as scales.js there is a reference to '../config.js' insteads of '../config'.

When you change these, it works fine.

bas080 commented 7 years ago

@depeter, thank you for the solution. A PR is ready for review. #14.