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

Plugin breaks library with type: module field in package.json #122

Closed
dvakatsiienko opened this issue Sep 30, 2022 · 2 comments
Closed

Plugin breaks library with type: module field in package.json #122

dvakatsiienko opened this issue Sep 30, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dvakatsiienko
Copy link

dvakatsiienko commented Sep 30, 2022

Given

vite-plugin-dts version: 1.6.3
vite version: 3.1.4

package.json:

{
  "name" : "my-lib",
  "type": "module",
  ...
}

vite.config.ts:

// imports

export default defineConfig({
  // other configs
  plugins: [dts({ config })]
})

An error:

failed to load config from /Users/furthur/Projects/anadea/next-lib/vite.config.ts
error during build:
ReferenceError: __filename is not defined in ES module scope
    at isFileSystemCaseSensitive (file:///Users/furthur/Projects/anadea/next-lib/node_modules/vite-plugin-dts/dist/index.mjs:11047:46)
    at getNodeSystem (file:///Users/furthur/Projects/anadea/next-lib/node_modules/vite-plugin-dts/dist/index.mjs:10812:46)
    at file:///Users/furthur/Projects/anadea/next-lib/node_modules/vite-plugin-dts/dist/index.mjs:11367:20
    at file:///Users/furthur/Projects/anadea/next-lib/node_modules/vite-plugin-dts/dist/index.mjs:11374:8
    at file:///Users/furthur/Projects/anadea/next-lib/node_modules/vite-plugin-dts/dist/index.mjs:11389:4
    at file:///Users/furthur/Projects/anadea/next-lib/node_modules/vite-plugin-dts/dist/index.mjs:172321:3
    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async loadConfigFromBundledFile (file:///Users/furthur/Projects/anadea/next-lib/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:63495:21)
@qmhc qmhc added the bug Something isn't working label Sep 30, 2022
@qmhc
Copy link
Owner

qmhc commented Sep 30, 2022

Same to #119

@qmhc qmhc closed this as completed in 57e093d Sep 30, 2022
@dvakatsiienko
Copy link
Author

dvakatsiienko commented Sep 30, 2022

@qmhc great, it works now. thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants