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/lib/main.d.ts has been updated and it causes TypeScript error #12

Open
StanlyShauro opened this issue Jan 21, 2023 · 0 comments

Comments

@StanlyShauro
Copy link

Hello,

TypeScript throws error on plugins: [vuePlugin()].
In my opinion, It is caused by mismatching files in the plugin
esbuild-plugin-vue3/node_modules/esbuild/lib/main.d.ts (esbuild-plugin-vue3@0.3.1)
and in esbuild
esbuild/lib/main.d.ts (esbuild@0.17.0)

When I replace the content of the first file, the problem goes away.

The log:

    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
config/build/esbuild-config.ts:24:13 - error TS2322: Type 'import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild-plugin-vue3/node_modules/esbuild/lib/main").Plugin' is not assignable to type 'import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild/lib/main").Plugin'.
  Types of property 'setup' are incompatible.
    Type '(build: import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild-plugin-vue3/node_modules/esbuild/lib/main").PluginBuild) => void | Promise<void>' is not assignable to type '(build: import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild/lib/main").PluginBuild) => void | Promise<void>'.
      Types of parameters 'build' and 'build' are incompatible.
        Type 'import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild/lib/main").PluginBuild' is not assignable to type 'import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild-plugin-vue3/node_modules/esbuild/lib/main").PluginBuild'.
          The types of 'initialOptions.loader' are incompatible between these types.
            Type '{ [ext: string]: import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild/lib/main").Loader; } | undefined' is not assignable to type '{ [ext: string]: import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild-plugin-vue3/node_modules/esbuild/lib/main").Loader; } | undefined'.
              Type '{ [ext: string]: import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild/lib/main").Loader; }' is not assignable to type '{ [ext: string]: import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild-plugin-vue3/node_modules/esbuild/lib/main").Loader; }'.
                'string' index signatures are incompatible.
                  Type 'import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild/lib/main").Loader' is not assignable to type 'import("/home/stas/work/test/js/js_builder_test_1/node_modules/esbuild-plugin-vue3/node_modules/esbuild/lib/main").Loader'.
                    Type '"empty"' is not assignable to type 'Loader'.

24   plugins: [vuePlugin()]

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

1 participant