-
Notifications
You must be signed in to change notification settings - Fork 50
Closed
Description
Environment
Vite 4 with pure ESM
- Node
18.15.0 - Yarn
3.5.0 - Vite
4.2.1 - @sentry/vite-plugin
0.7.0
Steps to Reproduce
- Install and configure
@sentry/vite-pluginin a{ "type": "module" }project - Run Vite's build command
Configuration:
createSentryPlugin({
org: '[redacted]',
project: '[redacted]',
include: './dist',
authToken: environment.VITE_SENTRY_AUTH_TOKEN,
telemetry: false
}),Expected Result
Vite compiles the app successfully with Sentry plugin (as 0.6.0 does)
Actual Result
Vite fails to build due to a missing export (or a CommonJS-only export) in a package @sentry/bundler-plugin-core depends on.
failed to load config from /[redacted]/vite.config.ts
error during build:
file:///[redacted]/.yarn/cache/@sentry-bundler-plugin-core-npm-0.7.0-bf4461084c-b32002fac1.zip/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:16
import *** SourceMapSource *** from 'webpack-sources';
^^^^^^^^^^^^^^^
SyntaxError: Named export 'SourceMapSource' not found. The requested module 'webpack-sources' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'webpack-sources';
const *** SourceMapSource *** = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
Relevant PR that adds the webpack-sources import is #198
Metadata
Metadata
Assignees
Labels
No labels