krakenjs / kraken-example-with-specialization

An example Kraken app showing off template specialization features.
11 stars 9 forks source link

Application not working #2

Closed Amitosh1 closed 9 years ago

Amitosh1 commented 9 years ago

while trying url like

http://localhost:8000/setSpcl/yin (or) http://localhost:8000/setSpcl/yang

I am getting exception capture

aredridel commented 9 years ago

Are you running in prod or dev mode?

If prod, have you run the build with grunt build?

This usually means 'template not found', which often means it wasn't built.

Amitosh1 commented 9 years ago

I am running this on dev mode.

I tried changing to prod mode also. But there also while hitting yin or yang url main page is loading as yinyang but more info link worked properly On Jun 19, 2015 11:57 AM, "Aria Stewart" notifications@github.com wrote:

Are you running in prod or dev mode?

If prod, have you run the build with grunt build?

This usually means 'template not found', which often means it wasn't built.

— Reply to this email directly or view it on GitHub https://github.com/krakenjs/kraken-example-with-specialization/issues/2#issuecomment-113575437 .

grawk commented 9 years ago

I got a much more insightful error in production mode:

TypeError: Cannot read property 'substr' of undefined
    at peg$parseraw (/Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/dustjs-linkedin/lib/parser.js:2100:16)
    at peg$parsepart (/Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/dustjs-linkedin/lib/parser.js:401:12)
    at peg$parsebody (/Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/dustjs-linkedin/lib/parser.js:384:12)
    at peg$parsestart (/Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/dustjs-linkedin/lib/parser.js:374:12)
    at parse (/Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/dustjs-linkedin/lib/parser.js:2639:18)
    at Object.compiler.compile (/Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/dustjs-linkedin/lib/compiler.js:26:27)
    at /Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/adaro/lib/patch/index.js:82:64
    at /Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/adaro/lib/reader/js.js:39:13
    at /Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/engine-munger/lib/munger.js:89:13
    at /Users/medelman/src/krakex/kraken-example-with-specialization/node_modules/engine-munger/lib/cache.js:65:13
grawk commented 9 years ago

Trying to unwind this, but it appears that instead of "yin" there is a corrupted compiled template called "yinyangyang" that gets added to cache. yinyangyang

aredridel commented 9 years ago

It may be clearer with dust 2.5, which was the last one that worked perfectly with specialization.

aredridel commented 9 years ago

Looks like the changes to https://github.com/krakenjs/engine-munger/blob/v0.2.x/lib/munger.js#L83 are to blame. The template name is mangled twice, because that code tries to be compatible with both old and new dust.

aredridel commented 9 years ago

This is what we get for editing an AST as a string.

aredridel commented 9 years ago

Fixed by https://github.com/krakenjs/engine-munger/issues/34 and published as engine-munger@0.2.8