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

Error: The "mainEntryPointFilePath" value is not a declaration file #144

Closed
3 tasks done
Tanimodori opened this issue Nov 14, 2022 · 1 comment
Closed
3 tasks done

Comments

@Tanimodori
Copy link

Tanimodori commented Nov 14, 2022

Describe the bug

I'm using this plugin to generate dts for my cli tool viteburner which is in library mode and has multiple entrys (one for cli and one for importing). Previous build was success but when I try to turn on the rollupTypes, it will throw a error listed below:

PS> npm run build
> viteburner@0.4.1 build
> vite build

vite v3.2.3 building for production...
✓ 31 modules transformed.
dist/entry.js          0.38 KiB / gzip: 0.18 KiB
dist/index.js          2.43 KiB / gzip: 0.74 KiB
dist/cli.f6271bf6.js   23.61 KiB / gzip: 8.49 KiB
dist/entry.mjs          0.34 KiB / gzip: 0.17 KiB
dist/index.mjs          1.89 KiB / gzip: 0.82 KiB
dist/cli.abe6ec13.mjs   29.31 KiB / gzip: 9.16 KiB

[vite:dts] Start generate declaration files...
[vite:dts] Start rollup declaration files...
error during build:
Error: Error parsing C:\path\to\project\viteburner\api-extractor.json:
The "mainEntryPointFilePath" value is not a declaration file: C:\path\to\project\viteburner\dist\typings\entry
    at Function.prepare (C:\path\to\project\viteburner\node_modules\@microsoft\api-extractor\lib\api\ExtractorConfig.js:577:19)
    at rollupDeclarationFiles (C:\path\to\project\viteburner\node_modules\vite-plugin-dts\dist\index.cjs:176799:56)
    at Object.closeBundle (C:\path\to\project\viteburner\node_modules\vite-plugin-dts\dist\index.cjs:177200:15)
    at async Promise.all (index 0)
    at async PluginDriver.hookParallel (file:///C:/path/to/project/viteburner/node_modules/rollup/dist/es/shared/rollup.js:22676:9)
    at async Object.close (file:///C:/path/to/project/viteburner/node_modules/rollup/dist/es/shared/rollup.js:23750:13)
    at async Promise.all (index 0)
    at async build (file:///C:/path/to/project/viteburner/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:45238:13)
    at async CAC.<anonymous> (file:///C:/path/to/project/viteburner/node_modules/vite/dist/node/cli.js:756:9)

Turn off rollupTypes in vite.config.ts will be fine. Any ideas?

Reproduction

https://github.com/Tanimodori/viteburner/tree/adb6551a4e0599e914d1db23cc3c539c4b87be10

Steps to reproduce

  1. git clone https://github.com/Tanimodori/viteburner.git
  2. cd viteburner
  3. git checkout adb6551a4e0599e914d1db23cc3c539c4b87be10
  4. npm i
  5. npm run build

This should produce the same error above.

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 7.93 GB / 15.69 GB
  Binaries:
    Node: 16.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.819.0), Chromium (107.0.1418.42)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vite: ^3.2.3 => 3.2.3
    vite-plugin-dts: ^1.7.0 => 1.7.0

Validations

@Tanimodori
Copy link
Author

Confirmed fixed. Thank you!

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

Successfully merging a pull request may close this issue.

1 participant