Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty lineman-angular project breaks 'lineman config' #6

Closed
dcfsc opened this issue Feb 19, 2014 · 5 comments
Closed

Empty lineman-angular project breaks 'lineman config' #6

dcfsc opened this issue Feb 19, 2014 · 5 comments

Comments

@dcfsc
Copy link

dcfsc commented Feb 19, 2014

I am trying to modify an existing Angular project to use lineman. I am using NPM 1.3.6. I started with the lineman-angular-template but when I run 'lineman config' I get the error:

$ lineman config
/linetest/node_modules/lineman-angular/config/plugins/concat_sourcemap.coffee:11
            src: _(lineman.config.application.concat_sourcemap.js.src).without
                                                              ^
TypeError: Cannot read property 'js' of undefined
    at module.exports (/projects/howk/projects/1/linetest/node_modules/lineman-angular/config/plugins/concat_sourcemap.coffee:11:63)
    at requirePlugin (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:82:44)
    at /usr/lib/node_modules/lineman/lib/builds-app-config.coffee:26:20
    at Function.eval (eval at createIterator (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:643:19), <anonymous>:10:9)
    at lodash.(anonymous function) [as each] (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3619:27)
    at /usr/lib/node_modules/lineman/lib/builds-app-config.coffee:24:33
    at Function.tap (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:4013:5)
    at lodash.(anonymous function) [as tap] (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3619:27)
    at Function._.mixin.extendTap (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:56:37)
    at lodash.(anonymous function) [as extendTap] (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3619:27)
    at Object.module.exports.withPlugins (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:23:35)
    at Object.withPlugins (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3411:30)
    at Object.module.exports.withUserOverrides (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:34:21)
    at Object.withUserOverrides (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3411:30)
    at Object.module.exports.forGrunt (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:41:19)
    at ReadsConfiguration.module.exports.ReadsConfiguration.read (/usr/lib/node_modules/lineman/lib/reads-configuration.coffee:14:32)
    at Command.<anonymous> (/usr/lib/node_modules/lineman/lib/cli/main.coffee:57:40)
    at Command.<anonymous> (/usr/lib/node_modules/lineman/node_modules/commander/index.js:256:8)
    at Command.EventEmitter.emit (events.js:98:17)
    at Command.parseArgs (/usr/lib/node_modules/lineman/node_modules/commander/index.js:479:12)
    at Command.parse (/usr/lib/node_modules/lineman/node_modules/commander/index.js:377:21)
    at module.exports (/usr/lib/node_modules/lineman/lib/cli/main.coffee:82:22)
    at Object.<anonymous> (/usr/lib/node_modules/lineman/cli.js:3:26)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

So to figure out the problem, I started over with an empty project generated by lineman

$ lineman new angline
$ cd angline
$ lineman config
{ pkg: 
   { name: 'angline',
     title: 'An HTML/JS/CSS app',
     version: '0.0.1',
...

Now I install the lineman-angular plugin

$ npm install --save-dev lineman-angular
...
lineman-angular@0.2.0 node_modules/lineman-angular
├── underscore@1.5.2
├── coffee-script@1.6.3
├── grunt-angular-templates@0.3.12 (html-minifier@0.5.5)
└── grunt-ngmin@0.0.3 (ngmin@0.4.1)

Running 'lineman config' gives the above error.

$ lineman config
/projects/howk/projects/1/angline/node_modules/lineman-angular/config/plugins/concat_sourcemap.coffee:11
            src: _(lineman.config.application.concat_sourcemap.js.src).without
TypeError: Cannot read property 'js' of undefined
    at module.exports (/projects/howk/projects/1/angline/node_modules/lineman-an

I am a bit new at this. So am I missing a step? Do I need to add a config somewhere when installing the lineman-angular plugin? Or is the plugin itself missing something?

@searls
Copy link
Member

searls commented Feb 19, 2014

Could you make sure you update your lineman to the very newest version and try again? There was a bug in lineman config causing this as recently as 0.24.6 or so

On Wed, Feb 19, 2014 at 8:26 AM, dcfsc notifications@github.com wrote:

I am trying to modify an existing Angular project to use lineman. I am using NPM 1.3.6. I started with the lineman-angular-template but when I run 'lineman config' I get the error:

$ lineman config
/linetest/node_modules/lineman-angular/config/plugins/concat_sourcemap.coffee:11
            src: _(lineman.config.application.concat_sourcemap.js.src).without
                                                              ^
TypeError: Cannot read property 'js' of undefined
    at module.exports (/projects/howk/projects/1/linetest/node_modules/lineman-angular/config/plugins/concat_sourcemap.coffee:11:63)
    at requirePlugin (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:82:44)
    at /usr/lib/node_modules/lineman/lib/builds-app-config.coffee:26:20
    at Function.eval (eval at createIterator (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:643:19), <anonymous>:10:9)
    at lodash.(anonymous function) [as each] (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3619:27)
    at /usr/lib/node_modules/lineman/lib/builds-app-config.coffee:24:33
    at Function.tap (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:4013:5)
    at lodash.(anonymous function) [as tap] (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3619:27)
    at Function._.mixin.extendTap (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:56:37)
    at lodash.(anonymous function) [as extendTap] (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3619:27)
    at Object.module.exports.withPlugins (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:23:35)
    at Object.withPlugins (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3411:30)
    at Object.module.exports.withUserOverrides (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:34:21)
    at Object.withUserOverrides (/usr/lib/node_modules/lineman/node_modules/grunt/node_modules/lodash/lodash.js:3411:30)
    at Object.module.exports.forGrunt (/usr/lib/node_modules/lineman/lib/builds-app-config.coffee:41:19)
    at ReadsConfiguration.module.exports.ReadsConfiguration.read (/usr/lib/node_modules/lineman/lib/reads-configuration.coffee:14:32)
    at Command.<anonymous> (/usr/lib/node_modules/lineman/lib/cli/main.coffee:57:40)
    at Command.<anonymous> (/usr/lib/node_modules/lineman/node_modules/commander/index.js:256:8)
    at Command.EventEmitter.emit (events.js:98:17)
    at Command.parseArgs (/usr/lib/node_modules/lineman/node_modules/commander/index.js:479:12)
    at Command.parse (/usr/lib/node_modules/lineman/node_modules/commander/index.js:377:21)
    at module.exports (/usr/lib/node_modules/lineman/lib/cli/main.coffee:82:22)
    at Object.<anonymous> (/usr/lib/node_modules/lineman/cli.js:3:26)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

So to figure out the problem, I started over with an empty project generated by lineman

$ lineman new angline
$ cd angline
$ lineman config
{ pkg: 
   { name: 'angline',
     title: 'An HTML/JS/CSS app',
     version: '0.0.1',
...

Now I install the lineman-angular plugin

$ npm install --save-dev lineman-angular
...
lineman-angular@0.2.0 node_modules/lineman-angular
├── underscore@1.5.2
├── coffee-script@1.6.3
├── grunt-angular-templates@0.3.12 (html-minifier@0.5.5)
└── grunt-ngmin@0.0.3 (ngmin@0.4.1)

Running 'lineman config' gives the above error.

$ lineman config
/projects/howk/projects/1/angline/node_modules/lineman-angular/config/plugins/concat_sourcemap.coffee:11
            src: _(lineman.config.application.concat_sourcemap.js.src).without
TypeError: Cannot read property 'js' of undefined
    at module.exports (/projects/howk/projects/1/angline/node_modules/lineman-an

I am a bit new at this. So am I missing a step? Do I need to add a config somewhere when installing the lineman-angular plugin? Or is the plugin itself missing something?

Reply to this email directly or view it on GitHub:
#6

@dcfsc
Copy link
Author

dcfsc commented Feb 19, 2014

Thanks, Justin, but it looks like I am current. I also installed npm-check-updates and it reported up to date. Am I looking in the right place?

$ cat package.json 
{
  "name": "angline",
  "title": "An HTML/JS/CSS app",
  "version": "0.0.1",
  "private": true,
  "author": {
    "name": "John Doe",
    "company": "ACME, Inc."
  },
  "devDependencies": {
    "lineman": "~0.24.9",
    "lineman-angular": "~0.2.0"
  },
  "scripts": {
    "start": "lineman run",
    "test": "lineman spec-ci"
  }
}

@searls
Copy link
Member

searls commented Feb 19, 2014

Cool, we'll look into it

@searls
Copy link
Member

searls commented Feb 21, 2014

Okay, I was able to reproduce the issue and figured out (roughly) what's going on.

You have a global lineman install of < 0.23.0 in spite of your latest-and-greatest lineman & lineman-angular local installs. For some reason, the global lineman is loading the config (which doesn't contain concat_sourcemap, triggering the error), when it should be deferring immediately to the local Lineman.

To remedy your situation, you'll want to globally install the latest lineman:

$ npm install -g lineman

I want to stress, you did nothing wrong here. This is (or was) a bug in the Lineman's CLI. I'm going to investigate whether this bug still exists in newer versions of Lineman (I suspect I already fixed this) before I close this out.

Apologies, @dcfsc!! 😢

@searls
Copy link
Member

searls commented Feb 21, 2014

Yep, I just confirmed that the latest version of Lineman fixes this issue by always delegating to the local version (when present), meaning that the local version of Lineman will always win, regardless of whether it's newer or older than the global.

Updating your global lineman should fix you.

Apologies for the inconvenience!

@searls searls closed this as completed Feb 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants