Open g1ronn1mo opened 11 months ago
had the same issue, adding this to the package.json fixed it for me
@hirotaka any chance to merge this one?
Here's a script until fix has been merged:
/* eslint-disable no-console */
import { promises as fsPromises } from "fs";
import path from "path";
const packageJsonPath = path.join(
"node_modules",
"storybook-addon-nuxt",
"package.json",
);
async function fixPackageJson() {
try {
const packageJsonContent = await fsPromises.readFile(
packageJsonPath,
"utf-8",
);
const packageJson = JSON.parse(packageJsonContent);
if (!packageJson.type) {
packageJson.type = "module";
await fsPromises.writeFile(
packageJsonPath,
JSON.stringify(packageJson, null, 2),
);
console.log("Fixed package.json for storybook-addon-nuxt");
} else {
console.log("package.json already contains the 'type' property.");
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Error fixing package.json:", error.message);
}
}
fixPackageJson();
I got the Error:
Solution:
add "type": "module", to the
package.json
file inside the storybook-addon-nuxt folder.