question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

help: issue with fetching

See original GitHub issue

📚 What are you trying to do? Please describe. I run my vue 3.0 project successfully, but the page source didn’t show my data, and send me a error message; Code

setup() {
    const route = useRoute();
    const data = ref({});
    const { id = "" } = route.value.params;
    const fetchData = async () => {
      let detail = await Api.detail(id);
      detail.content = marked(detail.content);
      data.value = detail;
    };

    const { fetch, fetchstate } = useFetch(async () => {
      await fetchData();
    });
    fetch();
    fetchstate;

    return {
      data,
    };
  },

Error

 ERROR  Error in fetch(): Cannot read property 'data' of undefined                                                                                                            18:17:54

  at module.exports../utils/request.js.baseURL (server.js:5693:19)
  at process._tickCallback (internal/process/next_tick.js:68:7)

(Sorry,My English is poor.)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
congyaqwqcommented, Mar 31, 2021

I found the question, It cause by axiox, It maybe used by other library, so I need to create a new instance; const instance = axios.create() My project run successfully, I will read the document carefully next time ! Thank you !

1reaction
danielroecommented, Mar 30, 2021

@congyaqwq You shouldn’t need to manually trigger fetch() at all - it will be done by useFetch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting & Support — Fetch Help - Fetch Softworks
If you cannot find the answer via the above methods, you can submit your problem or question using the Fetch Softworks feedback page....
Read more >
Call of Duty Warzone: How to Fix Error Stuck On Fetching ...
COD Warzone users are stuck in the Fetching Online Profile message error and eventually got booted out, here are 11 ways that should...
Read more >
How to Fix Error Fetching Data on Facebook - Technipages
If you're using the mobile app, update the app, and clear the cache. Did these troubleshooting suggestions help you fix the problem? Share...
Read more >
Account Login Issues – Fetch
If this still does not help and you are still unable to log in, please reach out to our Customer Support Team so...
Read more >
Fix "There was a problem fetching your zap data." error in ...
If you see a "there was a problem fetching your data" error, your destination app step: Might not have any data from the......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found