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

Compiling with "client: true" option creates invalid output #169

Open
sanojian opened this issue May 13, 2016 · 2 comments
Open

Compiling with "client: true" option creates invalid output #169

sanojian opened this issue May 13, 2016 · 2 comments

Comments

@sanojian
Copy link

By default, compileDebug option is true and invalid output is generated. A "pug_rethrow" function is inserted into the code and it will not parse.

Setting "compileDebug: false" is a workaround to get around this problem until it is fixed.

@sanojian
Copy link
Author

It seems that the issue is that somehow the "inlineRuntimeFunctions" option of pug-code-gen is getting set to true by default. If I set this option to false it no longer generates extra code that breaks the parsing.

@sumeetattree
Copy link

To add to this, options.inlineRuntimeFunctions is also breaking the output when options.namespace is set to a truthy value. This is the output it generates:

this['Namespace']['fileName'] = function pug_escape(e){...};
function template(locals){...}

To get around this you need to manually set options.inlineRuntimeFunctions to false and include pug-runtime with your template functions.

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