Skip to content

Vite rolldown incompatibility with datadogVitePlugin #218

@mkonecny

Description

@mkonecny

Describe what happened

Vite is planning to replace it's esbuild + rollup bundler system with a new rust-based "rolldown" bundler

https://vite.dev/guide/rolldown.html

When running a full vite build with telemetry enabled, and using this new Vite rolldown system (which advertises itself as a drop-in replacement), I get an error if telemetry is enabled

Steps to reproduce the issue:

vite config:

      datadogVitePlugin({
        disableGit: true,
        auth: {
          apiKey: DATADOG_API_KEY,
        },
        rum: {
          sourcemaps: {
            bailOnError: true,
            releaseVersion: `app@${GIT_COMMIT}.vite`,
            service: 'x',
            minifiedPathPrefix: '/static',
          },
        },
        telemetry: {
          disabled: false, // setting this to "true" fixes the error
        },
      })

and the run yarn vite build

Expected behaviour:

Build should complete successfully

Actual behaviour:

[error] error during build:
TypeError: Expected a finite number, got undefined: undefined
    at module.exports (/Users/mkonecny/app/node_modules/pretty-bytes/index.js:70:9)
    at file:///Users/mkonecny/app/node_modules/@datadog/vite-plugin/dist/src/index.mjs:12:13427
    at Array.map (<anonymous>)
    at file:///Users/mkonecny/app/node_modules/@datadog/vite-plugin/dist/src/index.mjs:12:13399
    at Oe (file:///Users/mkonecny/app/node_modules/@datadog/vite-plugin/dist/src/index.mjs:12:13552)
    at d (file:///Users/mkonecny/app/node_modules/@datadog/vite-plugin/dist/src/index.mjs:12:21611)
    at async buildReport (file:///Users/mkonecny/app/node_modules/@datadog/vite-plugin/dist/src/index.mjs:12:22607)
    at async Promise.all (index 0)
    at async PluginContextImpl.closeBundle (file:///Users/mkonecny/app/node_modules/@datadog/vite-plugin/dist/src/index.mjs:12:32686)
    at async plugin (file:///Users/mkonecny/app/node_modules/rolldown/dist/shared/src-Chn1S4O2.mjs:3167:4)
    at async plugin.<computed> (file:///Users/mkonecny/app/node_modules/rolldown/dist/shared/src-Chn1S4O2.mjs:3417:12)
error Command failed with exit code 1.

Additional context

Latest Vite rolldown (7.1.5)
@datadog/vite-plugin 2.6.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions