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

TwigException: Unable to find template file <hash> using webpack resolve #42

Open
larsboldt opened this issue Jun 21, 2018 · 2 comments

Comments

@larsboldt
Copy link

larsboldt commented Jun 21, 2018

Instead of using relative paths in includes in twig files we define a base path for resolving files in webpack resolve modules config.

Then we can write include 'path/to/file.twig' instead of '../../../file.twig' in one context and '../file.twig' in another context.

However, when doing this webpack build crash with following message:

ERROR in Template execution failed: TwigException: Unable to find template file 4a3a762861ed317664eb1c1814e583128a01b7c98ab3dff85c81c19f205b14e9138bcc288a085991f6f13a3fcc4eb883cd3e984abaa13f5353799ac8e3350bdb

ERROR in   Error: Unable to find template file 4a3a762861ed317664eb1c1814e583128a01b7c98ab3dff85c81c19f205b14e9138bcc288a085991f6f13a3fcc4e  b883cd3e984abaa13f5353799ac8e3350bdb


ERROR in Template execution failed: TwigException: Unable to find template file cf0210d582a43343c2e99ae79fb557adf71168a044b412308a365be5af4a9d32dc511b91d584bb547ab8f3da0453d19e2ba01ae3b47baa9dac9b45489aacb543

ERROR in   Error: Unable to find template file cf0210d582a43343c2e99ae79fb557adf71168a044b412308a365be5af4a9d32dc511b91d584bb547ab8f3da0453  d19e2ba01ae3b47baa9dac9b45489aacb543

Any ideas?

@jnowland
Copy link

jnowland commented May 2, 2019

I'm having a similar issue using webpack's "resolve alias".

This generates a hash but not the file. Is there a work around?

@ben-rogerson
Copy link

@larsboldt Another loader by megahertz should take care of this issue combined with a Webpack alias. Today I integrated it into my craft-storybook-starter if you want to take a look.

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

3 participants