I migrated my vue app from v2 to v3 and now when I use a component with slots then it gives error,
Uncaught TypeError: Cannot read properties of null (reading 'isCE')
But if I remove slots then it works.
This is my rollup.config.js file that has the config for loading the vue app.
I tried different configuration but didnt work.
import vue from "rollup-plugin-vue"; // Handle .vue files
import resolve from "@rollup/plugin-node-resolve"; // Teach Rollup how to find external modules
import commonjs from "@rollup/plugin-commonjs"; // Convert CommonJS modules to ES6
import image from "@rollup/plugin-image";
import copy from "rollup-plugin-copy";
import pjson from "./package.json" assert { type: "json" };
import scss from "rollup-plugin-scss";
import url from "@rollup/plugin-url";
export default {
external: ["vue"],
input: "src/index.js", // Entry point for your app
output: {
format: "esm",
file: "dist/library.js",
exports: "auto",
},
plugins: [
resolve({
browser: true, // Browser target (if necessary)
dedupe: ["vue"], // Avoid duplicated packages
}),
scss({
prefix: `@use 'sass:math'; @import "./src/css/index.scss";`,
}),
vue({
template: {
isProduction: true,
},
}),
commonjs(),
copy({
targets: [
{ src: "src/css/index.scss", dest: "dist/" },
{ src: "src/img/*", dest: "img/" },
{
src: "src/config/lang/*",
dest: "dist/lang",
rename: (name, extension, fullPath) => `global_${name}.${extension}`,
},
],
}),
image(), // Optional: Minify JavaScript
url({
// by default, rollup-plugin-url will not handle font files
include: [
"**/*.svg",
"**/*.png",
"**/*.jpg",
],
publicPath: "/public",
}),
],
};