frappe / frappejs

Node + Electron + Vue based metadata web framework (inspired by Frappe)
263 stars 110 forks source link

Cant get Started following the docs procedure... #102

Open joshiparthin opened 5 years ago

joshiparthin commented 5 years ago

Just made the project structure following the docs: https://github.com/frappe/frappejs/blob/master/docs/app.md

Cant get started with it... throwing some error:

$ ./node_modules/.bin/frappe start 
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1171:7)
    at resolveAppDir (/Users/parthjoshi/work/code/frappejs/node_modules/frappejs/webpack/utils.js:37:15)
    at getConfig (/Users/parthjoshi/work/code/frappejs/node_modules/frappejs/webpack/config.js:81:27)
    at Object.<anonymous> (/Users/parthjoshi/work/code/frappejs/node_modules/frappejs/webpack/serve.js:14:23)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
Parths-MacBook-Pro:frappejs parthjoshi$ ./node_modules/.bin/frappe start src/main.js 
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1171:7)
    at resolveAppDir (/Users/parthjoshi/work/code/frappejs/node_modules/frappejs/webpack/utils.js:37:15)
    at getConfig (/Users/parthjoshi/work/code/frappejs/node_modules/frappejs/webpack/config.js:81:27)
    at Object.<anonymous> (/Users/parthjoshi/work/code/frappejs/node_modules/frappejs/webpack/serve.js:14:23)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
mr-karan commented 5 years ago

+1 same issue. Looks like we need to check for undefined in resolveAppDir in utils.js ?

Something like this, works:

function resolveAppDir(...args) {
  for (let arg of args) {
    if (arg != undefined) {
      return path.resolve(getAppDir(), ...args);
    }
  }
}
mr-karan commented 5 years ago

Actually, the issue is in old frappe.conf.js in docs and the new structure used in the repo. entryHtml srcDir values were undefined.