sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Error [ERR_REQUIRE_ESM]: require() of ES Module not supported #233

Closed tomoat closed 2 years ago

tomoat commented 2 years ago

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/tomato/project/node_modules/.pnpm/globby@13.1.1/node_modules/globby/index.js from /Users/tomato/project/dist/utils.js not supported. Instead change the require of index.js in /Users/tomato/project/dist/utils.js to a dynamic import() which is available in all CommonJS modules.

version: globby@13.1.1

import { globbySync } from 'globby'

const path = globbySync(['*', '!cake'])
console.log(path)
fisker commented 2 years ago

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c