Subscribe on changes!

[Question] how can I get the error.message in errorComponent

avatar
Nov 30th 2023

Vue version

all

Link to minimal reproduction

https://codesandbox.io/p/sandbox/demo-load-remote-vue3-comp-lazy-forked-93nsyn

Steps to reproduce

visit the demo

What is expected?

I can get err ref or err message string in the ErrComponent

What is actually happening?

currently I can not get err ref or err message string in the ErrComponent by reading defineAsyncComponent doc

System Info

Browsers

Any additional comments?

No response

avatar
Nov 30th 2023

errorComponent receives an error prop. You should modify the code accordingly:

export default {
  name: "ErrorComponent",
    props: {
      error: Error,
    },
};

playground

avatar
Nov 30th 2023

it works, thx a lot