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

Object is possibly 'undefined' #1453

Open
9mm opened this issue Aug 28, 2024 · 1 comment
Open

Object is possibly 'undefined' #1453

9mm opened this issue Aug 28, 2024 · 1 comment

Comments

@9mm
Copy link

9mm commented Aug 28, 2024

I'm getting a lot of errors for typescript in nuxt image. I am using nuxt v4 compatibility mode if that makes a difference

 ERROR(vue-tsc)  Object is possibly 'undefined'.
 FILE  /Users/zesty/Code/xxx-frontend/node_modules/.pnpm/@nuxt+image@1.7.1_ioredis@5.4.1_magicast@0.3.5_rollup@4.21.1/node_modules/@nuxt/image/dist/runtime/components/NuxtPicture.vue:20:16

    18 |       :src="sources[lastSourceIndex].src"
    19 |       :sizes="sources[lastSourceIndex].sizes"
  > 20 |       :srcset="sources[lastSourceIndex].srcset"
       |                ^^^^^^^^^^^^^^^^^^^^^^^^
    21 |     >
    22 |   </picture>
    23 | </template>
@danielislas3
Copy link

I’m hitting the same issue, and I believe it’s related to the latest release v3.13.0. It seems that there were changes in the types, which might be causing this problem. I found this Vue TypeScript Changes that mentions updates to TypeScript handling, but I’m still unsure how to resolve the 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

2 participants