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

Error pages (404.js) not rendering in production mode #453

Open
muguatnus opened this issue Apr 5, 2016 · 8 comments
Open

Error pages (404.js) not rendering in production mode #453

muguatnus opened this issue Apr 5, 2016 · 8 comments
Projects

Comments

@muguatnus
Copy link

Hi
I am using following versions on my application

"kraken-js": "0.7.5"
"adaro": "0.1.7"

When I run the application in development mode it is redirecting 404 page. But in the production mode it is not happening. It is throwing following error.

500 Error: Could not load template
   at Object.onLoad (C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\makara\lib\view\js.js:84:22)
   at Object.cache.get (C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\makara\lib\cache.js:61:14)
   at C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\adaro\lib\reader\file.js:62:16
   at onChunk (C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\adaro\lib\patch\index.js:69:29)
   at Chunk.map (C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\dustjs-linkedin\lib\dust.js:370:3)
   at C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\adaro\lib\patch\index.js:91:39
   at Object.dust.load [as __cabbage__] (C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\dustjs-linkedin\lib\dust.js:51:12)
   at Object.cabbage [as load] (C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\adaro\lib\patch\index.js:98:21)
   at Object.dust.render (C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\dustjs-linkedin\lib\dust.js:22:8)
   at engine (C:\Mugu\Project\NI_74\mlp\mlp-webapp\node_modules\adaro\lib\engine.js:133:14)

When I dig the code I understood that 'views' become empty after this line of code
https://github.com/krakenjs/adaro/blob/v0.1.7/lib/engine.js#L95

This is only for error pages. For other application pages its is returning folder path '.build\templates\GB\en'

Also in line 84
https://github.com/krakenjs/adaro/blob/v0.1.7/lib/engine.js#L84

value of settings.views in Option argument coming as

Normal pages - folder path
Error page -file path

Please help me @jeffharrell @aredridel @jasisk @grawk @totherik

Thanks,
K.Mugunthan

@muguatnus muguatnus changed the title Error page (404.js) not rendering in production mode Error pages (404.js) not rendering in production mode Apr 5, 2016
@aredridel
Copy link
Contributor

what version of dust are you using?

Those are really old versions ... I don't know what might be wrong offhand, and my first thought is 'please please please upgrade'

@muguatnus
Copy link
Author

I am using "dustjs-linkedin": "2.0.3"

@aredridel
Copy link
Contributor

Yeah, wow. So much has changed for the better since then. You could be hitting any number of bugs or misconfigurations. Which Express?

@muguatnus
Copy link
Author

Express - 3.16.10.
I am not facing any other major issues.

@aredridel
Copy link
Contributor

I think those versions work together but it's before my time in Kraken.

@muguatnus
Copy link
Author

Thanks. I am unable to update the modules now. I want to dig more and find-out the issue.

Can you please give me a hint that which module will call this method ?
https://github.com/krakenjs/adaro/blob/v0.1.7/lib/engine.js#L84

@aredridel
Copy link
Contributor

express.

@muguatnus
Copy link
Author

HI @aredridel

It is working fine and error page is rendering in the production mode if I change this line as follows

https://github.com/krakenjs/makara/blob/v0.3.5/lib/util.js#L70

Change
root : file.replace(name, '') to root : file.replace(name.replace('/','\\'), '')

But I cannot see the util.js file in latest makara versions. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Triage
Doing
Development

No branches or pull requests

2 participants