Skip to content

Esbuild: plugin throws a warning when the entry point doesn't have a default export #747

@nikolovlazar

Description

@nikolovlazar

Environment

  • node: 23.9.0
  • esbuild: 0.25.5
  • @sentry/esbuild-plugin: 3.5.0

Steps to Reproduce

Just added the @sentry/esbuild-plugin:

import 'dotenv/config';
import esbuild from 'esbuild';
import { sentryEsbuildPlugin } from '@sentry/esbuild-plugin';

esbuild.build({
  entryPoints: ['index.ts'],
  sourcemap: true,
  bundle: true,
  minify: true,
  platform: 'node',
  outdir: 'dist',
  allowOverwrite: true,
  plugins: [
    sentryEsbuildPlugin({
      authToken: process.env.SENTRY_AUTH_TOKEN,
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,
      sourcemaps: {
        filesToDeleteAfterUpload: ['**/*.js.map'],
      },
    }),
  ],
});

If I comment out the plugin the warning is not being displayed. My entry point index.ts file does not have any exports. It's an express.js app so I don't have anything to export.

Expected Result

Not see a warning

Actual Result

I'm getting the following warning when I'm running the build:

▲ [WARNING] Import "default" will always be undefined because there is no matching export in "index.ts" [import-is-undefined]

    index.ts?sentryProxyModule=true:4:44:
      4 │               export default OriginalModule.default;
        ╵                                             ~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions