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

_resolveDef function access props but it is undefined #6895

Closed
AngryChocobo opened this issue Oct 17, 2022 · 8 comments · Fixed by #6182
Closed

_resolveDef function access props but it is undefined #6895

AngryChocobo opened this issue Oct 17, 2022 · 8 comments · Fixed by #6182
Labels
🐞 bug Something isn't working scope: custom elements

Comments

@AngryChocobo
Copy link

Vue version

^3.2.40

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-bjiedl?file=src/App.vue

Steps to reproduce

  1. npm run dev
  2. check console, will receive error: Uncaught TypeError: Cannot read properties of undefined (reading 'dataV7a7a37b1') at resolve2 (vue.js?v=f51652de:7665:28)

I am not sure vue version is 3.2.37.. I console log the varible in debuuger

What is expected?

Webcomponent can success render.

What is actually happening?

In runtime-dom.esm-bundler.js _resolveDef function props is undefined.

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i5-10600KF CPU @ 4.10GHz
    Memory: 4.34 GB / 15.91 GB
  Binaries:
    Node: 16.13.1 - C:\Program Files\nodejs\node.EXE        
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (106.0.1370.42)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vue: ^3.2.38 => 3.2.41

Any additional comments?

No response

@edison1105 edison1105 added the 🐞 bug Something isn't working label Oct 17, 2022
@edison1105
Copy link
Member

const hasOptions = !isArray(props)

We should also check the props is not undefined
PR welcome.

@LinusBorg
Copy link
Member

LinusBorg commented Oct 17, 2022

I did a PR for that already months ago. Seems ro have been drowned out a bit. #6182

So this issue is a duplicate, but the original issue seems to have been closed by the author.

So we'll leave this one.

@AngryChocobo
Copy link
Author

AngryChocobo commented Oct 17, 2022

@defaude So how can I skip this question? I am stucked. 😂

@LinusBorg
Copy link
Member

i think a workaround was to define an empty props object in the component? Not sure, can't test right now

@AngryChocobo
Copy link
Author

@LinusBorg Thanks. It works.

<script lang="ts" setup>
defineProps<{ somePatch: string }>();
</script>

@LinusBorg
Copy link
Member

Please don't close it, it's still so a bug 😅

@AngryChocobo
Copy link
Author

Please don't close it, it's still so a bug 😅

I found this bug had been resolved and merged into master. I am a inexperienced programmer. I want to ask when vue will release a new version after pr is merged? I know it is not a important bug. Just want to learn the vue's release plan.

@LinusBorg
Copy link
Member

We will release a new version, sure. But we necessarily don't do so after every merged PR - often we have some accumulate and release them together in a patch release.

You can expect a release in the next couple of days I think

chrislone pushed a commit to chrislone/core that referenced this issue Feb 4, 2023
zhangzhonghe pushed a commit to zhangzhonghe/core that referenced this issue Apr 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: custom elements
Projects
None yet
3 participants