question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find viewEngine for /.../app/view/index.tpl

See original GitHub issue
  • Node Version: 7.6.0
  • Egg Version: 1.0.0-rc.1
  • Plugin Name: egg-view-nunjucks
  • Plugin Version: 2.0.0
  • Platform: macOS 10.12.3

My configs

// {app_root}/config/plugin.js
exports.nunjucks = {
  enable: true,
  package: 'egg-view-nunjucks',
};
exports.view = {
  defaultViewEngine: 'nunjucks',
  mapping: {
    '.tpl': 'nunjucks',
  },
};

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (15 by maintainers)

github_iconTop GitHub Comments

13reactions
geeyucommented, Apr 28, 2017
module.exports = appInfo => {
  const config = {};

  config.keys = appInfo.name + '_1493400288522_208';
  config.view = {
    defaultViewEngine: 'nunjucks',
    mapping: {
      '.tpl': 'nunjucks',
    },
  };

  return config;
};

这样写就好了

4reactions
geekdadacommented, Feb 25, 2017

写错配置…

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found