twig-html-loader icon indicating copy to clipboard operation
twig-html-loader copied to clipboard

Loader adds extra separators into namespaces

Open radiocity opened this issue 6 years ago • 0 comments

// webpack.config.js
// ...
namespaces: {
   'layouts': `${src}/twig/layouts`,
   'components': `${src}/twig/components`,
},
// ...
{% import "@components/footer.twig" as footer %}
ERROR in ./source/twig/index.twig (./node_modules/html-webpack-plugin/lib/loader.js!./source/twig/index.twig)
 Module build failed (from ./node_modules/twig-html-loader/index.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TwigException: Unable to find template file /app/source/twig/components//////////footer.twig
     at runLoaders (/app/node_modules/webpack/lib/NormalModule.js:298:13)
     at /app/node_modules/loader-runner/lib/LoaderRunner.js:367:11
     at /app/node_modules/loader-runner/lib/LoaderRunner.js:233:18
     at Object.context.callback (/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
     at Object.loader (/app/node_modules/twig-html-loader/index.js:87:10)

radiocity avatar Mar 29 '19 16:03 radiocity