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

Unable to follow symbol for "Omit" #369

Closed
3 tasks done
wowblvck opened this issue Aug 13, 2024 · 1 comment
Closed
3 tasks done

Unable to follow symbol for "Omit" #369

wowblvck opened this issue Aug 13, 2024 · 1 comment

Comments

@wowblvck
Copy link

Describe the bug

When trying to build a component library, an error occurs:

[vite:dts] Internal Error: Unable to follow symbol for "Omit"

If you disable rollupTypes, the build runs normally.

The problem is very similar #367

vite.config.js:

import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import svgr from "vite-plugin-svgr";
import mkcert from "vite-plugin-mkcert";

import { libInjectCss } from "vite-plugin-lib-inject-css";

import { resolve } from "path";

const resolvePath = (path: string) => resolve(__dirname, path);

import { peerDependencies } from "./package.json";

export default defineConfig(() => {
  return {
    plugins: [
      react(),
      svgr(),
      libInjectCss(),
      dts({ rollupTypes: true }),
      mkcert(),
    ],
    build: {
      target: "esnext",
      minify: true,
      cssCodeSplit: true,
      lib: {
        entry: resolvePath("lib/index.ts"),
        formats: ["es", "cjs"],
        fileName: "index",
      },
      rollupOptions: {
        external: ["react/jsx-runtime", ...Object.keys(peerDependencies)],
        input: {
          main: resolvePath("lib/index.ts"),
          toast: resolvePath("lib/assets/styles/toast.css"),
        },
      },
      emptyOutDir: true,
    },
  };
});

Reproduction

Not related

Steps to reproduce

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 6800H with Radeon Graphics
    Memory: 3.82 GB / 15.19 GB
  Binaries:
    Node: 20.16.0
    npm: 10.8.2
  npmPackages:
    @vitejs/plugin-react-swc: ^3.7.0 => 3.7.0
    vite: ^5.4.0 => 5.4.0
    vite-plugin-dts: ^4.0.2 => 4.0.2

Validations

@qmhc
Copy link
Owner

qmhc commented Aug 14, 2024

Fix by #366.

@qmhc qmhc closed this as completed Aug 14, 2024
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