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

Unable to include twig component #67

Open
YanaLushch opened this issue Jul 14, 2021 · 2 comments
Open

Unable to include twig component #67

YanaLushch opened this issue Jul 14, 2021 · 2 comments

Comments

@YanaLushch
Copy link

When I try to include twig component I receive the following error:

Unable to find template file @molecules/inline/inline.twig. TypeError: fs.statSync is not a function

    "@babel/cli": "^7.12.13",
    "@babel/core": "^7.12.13",
    "webpack": "^4",
    "webpack-cli": "^4.7.2",
    "@storybook/react": "^6.3.0-rc.11",

web pack config :

use: [
          {
            loader: 'twig-loader',
            options: {
              twigOptions: {
                allowInlineIncludes: true,
                namespaces: {
                  icons: path.resolve(__dirname, 'images/icons'),
                  base: path.resolve(__dirname, 'components/00-base'),
                  atoms: path.resolve(__dirname, 'components/01-atoms'),
                  molecules: path.resolve(__dirname, 'components/02-molecules'),
                  organisms: path.resolve(__dirname, 'components/03-organisms'),
                  templates: path.resolve(__dirname, 'components/04-templates'),
                },
              },
            },
          },
        ],
@pjoulot
Copy link

pjoulot commented Jul 27, 2021

I have the same issue, did someone found out how to configure a namespace correctly?

@nourthe
Copy link

nourthe commented Aug 12, 2021

Hi @pjoulot @YanaLushch , I am rookie in webpack; I come from twig-html-loader and I was trying to use namespaces here too.
I found that there is no code for handle a twigOPtions.namespaces, and here is the reason in the comments: #47.

I don't understand too much to explain you, but hope I've helped you to close this issue.

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