Skip to content

Compatibility Issue Due to Documentation/Configuration Mismatch #30

@HamzaAmar

Description

@HamzaAmar

Hello,

I am encountering a compatibility issue after following your package's installation instructions. The documentation indicates that a specific package should be installed; however, the tsup configuration appears to be referencing an older, incompatible version. This discrepancy is causing conflicts and preventing the package from functioning correctly.

Reproduction Steps

  1. Installed the package as instructed:

    yarn add esbuild-plugin-react18
  2. Configured tsup I think it use your old package esbuild-react18-useclient as follows:

    // tsup.config.ts or tsup.config.js
    import { defineConfig } from "tsup";
    import react18Plugin from "esbuild-react18-useclient";
    
    const react18PluginOptions: React18PluginOptions = {}
    export default defineConfig(options => ({
        ...
        esbuildPlugins:[react18Plugin(react18PluginOptions)]
    }));
  3. Attempted to use the following configuration, but encountered a TypeScript error:

    import { defineConfig } from 'tsup'
    import react18Plugin, { React18PluginOptions } from 'esbuild-plugin-react18'
    
    const react18PluginOptions: React18PluginOptions = {}
    export default defineConfig({
      entry: ['src/index.ts'],
      format: ['cjs', 'esm'],
      splitting: false,
      sourcemap: true,
      dts: true,
      minify: true,
      treeshake: true,
      external: ['react', 'react-dom'],
      esbuildPlugins: [react18Plugin(react18PluginOptions)],
    })

    TypeScript Error:

                Type '"external" | "bundle" | undefined' is not assignable to type '"external" | undefined'.
                  Type '"bundle"' is not assignable to type '"external"'.ts(2322)

Request

Could you please take a look at the tsup configuration within the package and ensure it aligns with the documented dependencies? I would greatly appreciate your assistance in resolving this matter.

Thank you for your time and consideration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions