frctl / fractal

A tool to help you build and document website component libraries and design systems.
https://fractal.build
MIT License
2.1k stars 167 forks source link

Twig.js new release (1.16.0) dependency breaks the fractal adapter with this error: TwigException: Cannot extend an inline template #1258

Closed MicheleJohn closed 1 year ago

MicheleJohn commented 1 year ago

The new version of Twig.js breaks all the inline blocks rendering.

  1. Install fractal and this adapter
  2. Launch the project
  3. Build a component with the "block" tag
  4. Embed the component in a section

Reproduces how often:

100%

Context

I found a workaround removing the "^" from the dependency in the package.json.

Robbertdk commented 11 months ago

I also have the same issue. Removing the "^" from the dependency in the package.json in the @frctl/twig package was not an option for me because this setup is also part of our deployment street and a bad practice overall.

Instead I've overwritten the twig version via the "overrides" option in NPM (version 8.3 or newer)

"devDependencies": {
    "@frctl/fractal": "^1.5.15",
    "@frctl/twig": "^1.2.13",
    "@frctl/mandelbrot": "^1.10.3",
    ...
},
"overrides": {
  "@frctl/twig": {
    "twig": "~1.15.4"
  }
}

You can also change the package-lock file for older npm-versions

Still not a final solution but a better workaround.