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

ESBuild plugin dts warning. #42

Closed
5 tasks done
tmg0 opened this issue Mar 19, 2024 · 2 comments
Closed
5 tasks done

ESBuild plugin dts warning. #42

tmg0 opened this issue Mar 19, 2024 · 2 comments

Comments

@tmg0
Copy link
Contributor

tmg0 commented Mar 19, 2024

Describe the bug

Description

When I import unplugin-vue-jsx/esbuild in the vscode editor, the esbuild plugin displays a type error.

So I have to use the plugin like:

import { defineConfig } from 'tsup'
import VueJSX from 'unplugin-vue-jsx'

export default defineConfig(options => ({
  entry: ['src/index.ts'],
  esbuildPlugins: [VueJSX.esbuild({})]
}))

Noticed that the version of esbuild is declared in the package.json file of unplugin-vue-jsx. When using import * as esbuild from 'esbuild', it prefers this version, which seems to be the cause of the problem.

I'm not very clear if it's possible to remove the specified version of esbuild from the dependencies. Is there any special consideration for declaring it here? I build the project locally, and it seems to be fine after removal.

I created a new repository on StackBlitz, but it seems that the hints are different from those in my local editor, so I've included a screenshot.

截屏2024-03-19 16 25 52

Logs

Argument of type '(options: Options) => { entry: string[]; splitting: true; clean: true; treeshake: true; dts: true; format: ("cjs" | "esm")[]; minify: boolean; esbuildPlugins: Plugin[]; }' is not assignable to parameter of type 'Options | Options[] | ((overrideOptions: Options) => MaybePromise<Options | Options[]>)'.
  Type '(options: Options) => { entry: string[]; splitting: true; clean: true; treeshake: true; dts: true; format: ("cjs" | "esm")[]; minify: boolean; esbuildPlugins: Plugin[]; }' is not assignable to type '(overrideOptions: Options) => MaybePromise<Options | Options[]>'.

Reproduction

https://stackblitz.com/edit/stackblitz-starters-7or5g1

System Info

System:
    OS: macOS 14.2
    CPU: (8) arm64 Apple M2
    Memory: 67.39 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.1 - ~/.volta/tools/image/node/18.19.1/bin/node
    npm: 10.2.4 - ~/.volta/tools/image/node/18.19.1/bin/npm
    pnpm: 8.15.4 - ~/.volta/tools/image/pnpm/8.15.4/bin/pnpm
  Browsers:
    Chrome: 122.0.6261.129
    Safari: 17.2

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Copy link

stackblitz bot commented Mar 19, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sxzz sxzz closed this as completed in d6a7493 Mar 20, 2024
@sxzz
Copy link
Member

sxzz commented Mar 20, 2024

Should fixed & released as [email protected]

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