Open sundayz opened 2 years ago
In vue-toastification/composition/nuxt/index.js the line module.exports = { useToast }; causes an error on page load.
vue-toastification/composition/nuxt/index.js
module.exports = { useToast };
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?
Wouldn't export { useToast as default, useToast } work? (Even though I don't see why it is using a default export here)
export { useToast as default, useToast }
I am also facing this issue with nuxt (and compostion api) Any workarounds?
Versions
Describe the bug
In
vue-toastification/composition/nuxt/index.js
the linemodule.exports = { useToast };
causes an error on page load.Uncaught TypeError: "exports" is read-only
Is there a webpack/nuxt/typescript configuration option that fixes this?
Your Environment