sentry-javascript-bundler-plugins icon indicating copy to clipboard operation
sentry-javascript-bundler-plugins copied to clipboard

SyntaxError: Named export 'GLOBSTAR' not found

Open mishaled opened this issue 2 years ago • 3 comments

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.

mishaled avatar Oct 30 '23 14:10 mishaled

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?

lforst avatar Nov 03 '23 14:11 lforst

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

pirey avatar Mar 14 '24 23:03 pirey

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

lforst avatar Mar 15 '24 08:03 lforst

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 🥀

getsantry[bot] avatar Aug 27 '24 07:08 getsantry[bot]