Error Nuxt 3 on production only
NaosFr opened this issue Β· comments
Naos commented
Hello π I have this error on production only after nuxt build && nuxt start
on Nuxt 3
"nuxt": "3.0.0-rc.8"
"mosha-vue-toastify": "^1.0.23",
[nuxt] [request error] [unhandled] [500] Named export 'createToast' not found. The requested module 'mosha-vue-toastify' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'mosha-vue-toastify';
const { createToast } = pkg;
Any ideas thx ?
Naos commented
I have the solution:
β
import * as Taost from "mosha-vue-toastify";
β
import { createToast } from "mosha-vue-toastify";
Baidi(Tony) Liu commented
thank you Nicolas
Alexander Kim commented