You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Template paths are stored in the shared nunjucks.webpackDependencies object as is, without being resolved, which may lead to the corresponding template references being overwritten as next templates are being pre-compiled. As a result, if multiple templates use the same string literal as a relative path in include, import, or extend tags, they all will end up referencing the same template after compilation (which one it will be depends on the order they are imported in the JS file).
Consider the following example:
The same directory structure as in this repo, with include.njk files added in the hero and villain dirs:
(e.g. hero/default.njk and villain/default.njk respectively are meant to be included)
The expected results of rendering hero/include.njk and villain/include.njk would be I am a hero. and I am a villain. respectively, but in fact they are the same (either I am a hero. or I am a villain., depending on which template is imported first).
The text was updated successfully, but these errors were encountered:
Template paths are stored in the shared
nunjucks.webpackDependencies
object as is, without being resolved, which may lead to the corresponding template references being overwritten as next templates are being pre-compiled. As a result, if multiple templates use the same string literal as a relative path ininclude
,import
, orextend
tags, they all will end up referencing the same template after compilation (which one it will be depends on the order they are imported in the JS file).Consider the following example:
The same directory structure as in this repo, with
include.njk
files added in thehero
andvillain
dirs:Contents of these
include.njk
tempates:(e.g.
hero/default.njk
andvillain/default.njk
respectively are meant to be included)The expected results of rendering
hero/include.njk
andvillain/include.njk
would beI am a hero.
andI am a villain.
respectively, but in fact they are the same (eitherI am a hero.
orI am a villain.
, depending on which template is imported first).The text was updated successfully, but these errors were encountered: