vue-toastification
vue-toastification copied to clipboard
Uncaught TypeError: "exports" is read-only
Versions
- 1.7.14
Describe the bug
In vue-toastification/composition/nuxt/index.js
the line module.exports = { useToast };
causes an error on page load.
Uncaught TypeError: "exports" is read-only
const { useContext } = require("@nuxtjs/composition-api"); // eslint-disable-line @typescript-eslint/no-var-requires
export const useToast = () => useContext().app.$toast;
// Commenting this out fixes the problem, because useToast is being exported above anyway
module.exports = { useToast };
Is there a webpack/nuxt/typescript configuration option that fixes this?
Your Environment
- Nuxt 2.15.8 + Nuxt Composition API 0.26.0
Wouldn't export { useToast as default, useToast }
work? (Even though I don't see why it is using a default export here)
I am also facing this issue with nuxt (and compostion api) Any workarounds?