Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Named export 'GLOBSTAR' not found #431

Open
mishaled opened this issue Oct 30, 2023 · 3 comments
Open

SyntaxError: Named export 'GLOBSTAR' not found #431

mishaled opened this issue Oct 30, 2023 · 3 comments

Comments

@mishaled
Copy link

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
Copy link
Member

lforst commented Nov 3, 2023

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
Copy link

pirey commented Mar 14, 2024

hi @lforst this issue seems related to this one nodejs/node#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
Copy link
Member

lforst commented Mar 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

No branches or pull requests

3 participants