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

Missing required prop: "resource" #1

Open
bitsnaps opened this issue Nov 13, 2023 · 0 comments
Open

Missing required prop: "resource" #1

bitsnaps opened this issue Nov 13, 2023 · 0 comments

Comments

@bitsnaps
Copy link

Hi,

I get a weird warning about resource props, I thought because optional props are not required in this example since we've provided a default value and we're using the NotFound component in the path: /:catchAll(.*), so I set required to false in order to get rid of this warning:

main.js?t=1699883629605:10
[Vue warn]: Missing required prop: "resource" 
  at <NotFound onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <RouterView> 
  at <App>

Here is the change I made:

import { defineProps } from "vue";

defineProps({
  resource: {
    type: String,
    required: false, // <-- This has to be false?
    default: "page",
  },
});

Here are my versions:

  "dependencies": {
    "axios": "^1.6.1",
    "pinia": "^2.1.7",
    "vue": "^3.3.8",
    "vue-router": "^4.2.5"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^4.4.1",
    "vite": "^4.5.0"
  }
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

1 participant