Open THETCR opened 2 years ago
/src/stories/Button.tsx, /src/stories/Header.tsx and /src/stories/Page.tsx contain import statements for CSS files.
Even though the files array of the package manifest states "dist/*/", the Babel build scripts specify "--extensions ".js,.jsx,.ts,.tsx"". So that might be the reason that the CSS files are missing in the published package.
did you resolve the problem ?
i got similar error when i convert webpack to vite
[vite] Internal server error: Failed to resolve import "./header.css" from "node_modules/@storybook/builder-vite/node_modules/@storybook/mdx1-csf/dist/esm/stories/Header.js?v=1be64857". Does the file exist?
Plugin: vite:import-analysis
File: /Users/username/Documents/work/project/node_modules/@storybook/builder-vite/node_modules/@storybook/mdx1-csf/dist/esm/stories/Header.js?v=1be64857
2 | import React from 'react';
3 | import { Button } from './Button';
4 | import './header.css';
| ^
5 | import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
6 | import { Fragment as _Fragment } from "react/jsx-dev-runtime";
at formatError (file:///Users/username/Documents/work/project/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:40854:46)
at TransformContext.error (file:///Users/username/Documents/work/project/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:40850:19)
at normalizeUrl (file:///Users/username/Documents/work/project/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:37587:33)
at async TransformContext.transform (file:///Users/username/Documents/work/project/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:37720:47)
at async Object.transform (file:///Users/username/Documents/work/project/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:41103:30)
at async loadAndTransform (file:///Users/username/Documents/work/project/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:37365:29)
/src/stories/Button.tsx, /src/stories/Header.tsx and /src/stories/Page.tsx contain import statements for CSS files.
Even though the files array of the package manifest states "dist/*/", the Babel build scripts specify "--extensions \".js,.jsx,.ts,.tsx\"". So that might be the reason that the CSS files are missing in the published package.