-
Notifications
You must be signed in to change notification settings - Fork 71
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
Picture slots aren't working, throwing a message instead #103
Comments
Can you please provide a repro demo? You don't see any error in the picture demo |
Hi Alex, Thanks for your reply! I am trying to use the My component code is:
It renders to:
You can see the result in the main banner here -> https://unruffled-jones-e461c4.netlify.app/ On localhost the error is the one I mentioned in my first message. The component source code is located here. Thanks, |
I navigated to your site but I see no errors in the console... Additionally, it'd make it much easier to find out if you're able to provide an isolated reproduction demo. You can fork any of the codesandbox demos and make the error appear. |
You're right, an isolated reproduction is the best way. Here you go: https://codesandbox.io/s/v-lazy-image-use-picture-wde61?file=/src/App.vue |
I can confirm that I have this issue as well. To reproduce, simply use demo code with picture slot. Project setup :
|
I created a pull request to fix this issue, the solution was to use |
Using slots as described here -> https://vuedose.tips/use-responsive-images-with-v-lazy-image#picture throws this message:
(...args) => {
// If a user calls a compiled slot inside a template expression (#1745), it
// can mess up block tracking, so by default we disable block tracking and
// force bail out when invoking a compiled slot (indicated by the ._d flag).
// This isn't necessary if rendering a compiled
<slot>
, so we flip the// ._d flag off when invoking the wrapped fn inside
renderSlot
.if (renderFnWithContext._d) {
setBlockTracking(-1);
}
const prevInstance = setCurrentRenderingInstance(ctx);
const res = fn(...args);
setCurrentRenderingInstance(prevInstance);
if (renderFnWithContext._d) {
setBlockTracking(1);
}
if (true) {
devtoolsComponentUpdated(ctx);
}
return res;
}
The text was updated successfully, but these errors were encountered: