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

The rest of your code looks good, as long as your files have the extension .hbs. Try the following: #1

Open
khaitranhuynh opened this issue Jun 3, 2020 · 0 comments

Comments

@khaitranhuynh
Copy link
Owner

The rest of your code looks good, as long as your files have the extension .hbs. Try the following:

  1. Run

    npm install @handlebars/allow-prototype-access
  2. add the following to the beginning of of your file.

    const Handlebars = require('handlebars')
    const {allowInsecurePrototypeAccess} = require('@handlebars/allow-prototype-access')
  3. change the line

    const hbs = exphbs.create({
      defaultLayout: 'main',  
      extname: 'hbs',
    });

    to

    const hbs = exphbs.create({
      defaultLayout: 'main', 
      extname: 'hbs',
      handlebars: allowInsecurePrototypeAccess(Handlebars)
    });

Originally posted by @nknapp in handlebars-lang/handlebars.js#1648 (comment)

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

1 participant