linemanjs / lineman-angular

A Lineman plugin for Angular projects (for a quickstart, see lineman-angular-template)
8 stars 5 forks source link

$templateCache is missing after rebuild #1

Closed ingenork closed 10 years ago

ingenork commented 10 years ago
  1. Run lineman
  2. copy /generated/js/app.js to somewhere safe
  3. Trigger a rebuild by changing a sourcefile
  4. compare the new /generated/js/app.js with the initial

The $templateCache part is missing along with the //@ sourceMappingURL=app.js.map Which results in the browser getting stack overflow :(

I'm not sure how to solve this but I can see in the lineman log that the 'concat:js'-task is run instead of the 'concat_sourcemap:js'.

Let me know if you need any more info from me.

I hope it is a quick fix for you guys. Keep up the good work!

searls commented 10 years ago

Hey @davemo, since this project extracts your config, would you mind troubleshooting this for us?

On Wed, Dec 4, 2013 at 10:31 AM, ingenork notifications@github.com wrote:

  1. Run lineman
  2. copy /generated/js/app.js to somewhere safe
  3. Trigger a rebuild by changing a sourcefile
  4. compare the new /generated/js/app.js with the initial The $templateCache part is missing along with the //@ sourceMappingURL=app.js.map Which results in the browser getting stack overflow :( I'm not sure how to solve this but I can see in the lineman log that the 'concat:js'-task is run instead of the 'concat_sourcemap:js'. Let me know if you need any more info from me. I hope it is a quick fix for you guys. Keep up the good work!

    Reply to this email directly or view it on GitHub: https://github.com/testdouble/lineman-angular/issues/1

davemo commented 10 years ago

A quick glance it looks like extracting to the new plugin architecture broke this. Seems merging of the tasks isn't working with plugins as the one that should be run in the common phase is indeed concat_sourcemap:js. I can take a look more thoroughly this evening :)

searls commented 10 years ago

that was my presumption as well but I'm a bit swamped and afraid I can't look at this right away.

On Wed, Dec 4, 2013 at 10:38 AM, David Mosher notifications@github.comwrote:

A quick glance it looks like extracting to the new plugin architecture broke this. Seems merging of the tasks isn't working with plugins as the one that should be run in the common phase is indeed concat_sourcemap:js. I can take a look more thoroughly this evening :)

— Reply to this email directly or view it on GitHubhttps://github.com/testdouble/lineman-angular/issues/1#issuecomment-29815082 .

searls commented 10 years ago

I was not able to replicate this. When I clone a fresh lineman-angular-template.

I suspect one of the two is true: you're running a version of lineman earlier than 0.19.0 or you haven't run npm install such that lineman-angular is installed.

In case those are all fine, here's the output I see after cloning this repo, running npm install, and running lineman build:

Running "common" task

Running "ngtemplates:app" (ngtemplates) task
File generated/angular/template-cache.js created.

Running "coffee:compile" (coffee) task
>> Destination (generated/js/app.coffee.js) not written because compiled files were empty.
File generated/js/spec.coffee.js created.
>> Destination (generated/js/spec-helpers.coffee.js) not written because compiled files were empty.

Running "less:compile" (less) task
>> Destination not written because no source files were found.
File generated/css/app.less.css created.

Running "jshint:files" (jshint) task
>> 9 files lint free.

Running "images:dev" (images) task
Copying images to 'generated/img'

Running "webfonts:dev" (webfonts) task
Copying webfonts to 'generated/webfonts'

Running "pages:dev" (pages) task
generated/index.html generated from app/pages/index.us

Running "concat_sourcemap:js" (concat_sourcemap) task
File "generated/js/app.js" created.

Running "concat_sourcemap:spec" (concat_sourcemap) task
File "generated/js/spec.js" created.

Running "concat_sourcemap:css" (concat_sourcemap) task
File "generated/css/app.css" created.

Running "dist" task

Running "ngmin:js" (ngmin) task
ngminifying generated/js/app.js

Running "uglify:js" (uglify) task
File "dist/js/app.js" created.

Running "cssmin:compress" (cssmin) task
File dist/css/app.css created.

Running "images:dist" (images) task
Copying images to 'dist/img'

Running "webfonts:dist" (webfonts) task
Copying webfonts to 'dist/webfonts'

Running "pages:dist" (pages) task
dist/index.html generated from app/pages/index.us

Done, without errors.

And when I'm running lineman run and I change a template, I see the change and this output:

>> File "app/templates/login.html" changed.

Running "ngtemplates:app" (ngtemplates) task
File generated/angular/template-cache.js created.

Running "concat_sourcemap:js" (concat_sourcemap) task
File "generated/js/app.js" created.
ingenork commented 10 years ago

I was hoping that I'd forgot to update lineman, but I was running v1.9.0. I did update to 1.9.1 and also made sure that lineman-angular was installed.

As you say the rebuild is fine after modifying a template file.

However when modifying a js file (or anything else than a template, I assume) the concat task is run instead of the concat sourcemap.

File "app/js/controllers/channelCtrl.js" renamed.

Running "concat:js" (concat) task
File "generated/js/app.js" created.

Again, thanks for the support and fast response. I hope you can reproduce this error, I really want to solve it :)

searls commented 10 years ago

You are absolutely right and this is a bug in Lineman core. I'm working on it now.

searls commented 10 years ago

Upgrade to Lineman 0.19.2 and you should be good :smiley:

ingenork commented 10 years ago

It' working again, thanks!

/Viktor

On Thu, Dec 5, 2013 at 3:50 PM, Justin Searls notifications@github.comwrote:

Closed #1 https://github.com/testdouble/lineman-angular/issues/1.

— Reply to this email directly or view it on GitHubhttps://github.com/testdouble/lineman-angular/issues/1 .