getsentry / sentry-javascript-bundler-plugins

JavaScript Bundler Plugins for Sentry
https://sentry.io
BSD 3-Clause "New" or "Revised" License
143 stars 37 forks source link

SyntaxError: Named export 'GLOBSTAR' not found #431

Closed mishaled closed 2 months ago

mishaled commented 1 year ago

Environment

We are running version ^2.8.0. Once in a while, we start having persistent errors like this-

failed to load config from ***/vite.config.mjs
error during build:

import { GLOBSTAR } from 'minimatch';
         ^^^^^^^^
SyntaxError: Named export 'GLOBSTAR' not found. The requested module 'minimatch' 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 'minimatch';
const { GLOBSTAR } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

Steps to Reproduce

We are building a Vite project and uploading sourcemaps to Sentry with the plugin. The errors reproduce both locally and in our CI (jenkins).

Expected Result

No error in the build process.

Actual Result

An error reported.

lforst commented 1 year ago

Hm, I am not sure how I can reproduce this. Would you mind sharing a small reproduction example (repo we can pull or stackblitz or similar) so we can debug this?

pirey commented 8 months ago

hi @lforst this issue seems related to this one https://github.com/nodejs/node/issues/35893

the issue might be caused by

import { GLOBSTAR } from 'minimatch'

and can be resolved by change it to

import minimatch from 'minimatch'
const { GLOBSTAR } = minimatch
lforst commented 8 months ago

@pirey none of that code is in our package. I wouldn't know how to change that tbh. I'd need reproduction.

getsantry[bot] commented 3 months ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀