Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing CSS files in published package #7

Open
THETCR opened this issue Jun 1, 2022 · 1 comment
Open

Missing CSS files in published package #7

THETCR opened this issue Jun 1, 2022 · 1 comment

Comments

@THETCR
Copy link

THETCR commented Jun 1, 2022

/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.

@ebibura
Copy link

ebibura commented Oct 5, 2022

/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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants