Comments (12)
Wanted to leave this here for anyone that may come to this error.
This error is thrown when the data being passed through embeds and twig structure, is being broken, and a template is receiving null
.
The best solution is to check what variables are present in each template as you go down the line. If there are multiple errors like this in the stack, this will output multiple errors.
Example #1
Example #1 is the difference between these two examples. When the variable is null
, or does not exist due to typo or misalignment of data, this error will be thrown.
{% include '@themetheme/menu/menu.twig' with menu only %}
and
{% include '@themetheme/menu/menu.twig' with main_menu only %}
Example #2
The second example is the difference between these examples. Because of the use of the only
keyword, the site_footer
variable was not passed, and is null
is presented to the component. When the Twig include is executed as part of the layout.twig template, the data is not available.
{% embed '@theme/layout/layout.twig' with {
"modifier": "footer",
"site_footer": site_footer
} only %}
{% block page_footer %}
{% include '@theme/site-footer/site-footer.twig' with site_footer only %}
{% endblock page_footer %}
{% endembed %}
and
{% embed '@theme/layout/layout.twig' with {
"modifier": "footer",
} only %}
{% block page_footer %}
{% include '@theme/site-footer/site-footer.twig' with site_footer only %}
{% endblock page_footer %}
{% endembed %}
from bolt.
Hello!
We received your note - I will have someone respond shortly. Thank you for notifying us.
-Margo Romanowski
Bolt Design System Product Owner
from bolt.
@kemiga we ran into the same issue recently (might be an upstream dependency problem) and ended up needing to lock down the version of the @bolt/twig-renderer
composer.json file (in the packages/twig-renderer
folder) to be 1.36.0
+ re-run composer update.
At the moment our Travis CI builds seem to be checking out ok but this is still high on our radar to look further into + make sure everything is working as expected!
Out of curiosity, are you running the latest code that's up on master? Also, just wanted to double check: are you seeing this particular error message after (roughly) following the Developer Getting Started guide?
https://boltdesignsystem.com/docs/development/local-dev-environment-setup.html
from bolt.
@sghoweri yes cloned from master and have pulled the latest changes.
And yes I was following the getting started guide. npm run setup
runs without issues and on running npm start
everything builds/compiles fine until it starts compiling the static site.
The twig/twig version is set to 1.36.0 in the code I have checked out. I've tried re-running composer update in packages/twig-renderer but am still getting a 'PHP TwigRenderer Error'.
from bolt.
Hi, I've just done a fresh install and am having the same issue at the same point as kemiga.
from bolt.
Hi, this is still an issue for me in both the master and the 2.x branches
from bolt.
@AnthonySGeorge you can try npm run clean
and then composer clearcache
make sure that all 'vendor' and 'node_modules' folders. After this try to run npm run setup
and then npm start
.
from bolt.
@AnthonySGeorge I was having this issue too and just updating npm to the latest version worked for me.
from bolt.
I'm getting this issue as well, here's a link to my composer.lock
. I'm on master
. https://github.com/boltdesignsystem/bolt/blob/master/docs-site/composer.lock#L283
Steps taken:
rm -rf docs-site/vendor && composer install
rm -rf node_modules && yarn install && yarn start
from bolt.
Turned out this was because I was using node v12.13.0
. Node v12.10.0
works fine.
from bolt.
Are there any updates on this issue? I am experiencing the same error message when running npm run build
or npm run watch
(both gulp tasks). I have removed the node_modules
folder and also package-lock.json
but no luck. I even downgraded the node version to 12.10.0
as @glassdimly suggested. Here's my errors:
PHP TwigRenderer Error: The response callback is expected to resolve with an object implementing Psr\Http\Message\ResponseInterface, but rejected with "Error" instead.
. I'd appreciate any tips or feedback to solve this issue.
from bolt.
Thanks @Tregonia for the detailed info! ^^
from bolt.
Related Issues (20)
- Prevent non-deterministic package resolution in yarn HOT 1
- Consider using sassdoc to generate sass mixin, function, global variable documentation HOT 4
- Upgrade to the released lit-element package HOT 2
- Error: no such file or directory ./bolt/packages/build-tools/node_modules/find-up HOT 8
- Disabling JS affects the HTML syntax display on code-snippet syntax demo page HOT 2
- boltdesignsystem.com components page looks weird after hitting `back` HOT 3
- Simplify GH Issue Template
- .boltrc config: donβt parse non-component packages HOT 3
- Dropdown with shadow DOM disabled causes recursive loop
- Use of ` background-color: bolt-theme(primary)` delivers same color in IE 11 HOT 4
- `bolt-theme` uses final item in the map, irrespective of theme. HOT 3
- validateProps returns string `undefined` from destructured assignment HOT 2
- Support Multistep Build Process
- Support Mmultiple Data Directories
- Support PHP 7.4 HOT 1
- Support node 13 HOT 3
- Register namespace "bolt" HOT 1
- Can Bolt Design System be used in combination with Gatsby? HOT 1
- Feature Request: CDN
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bolt.