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

Error [ERR_REQUIRE_ESM]: require() of ES Module #67

Closed
leosin opened this issue Mar 15, 2022 · 5 comments
Closed

Error [ERR_REQUIRE_ESM]: require() of ES Module #67

leosin opened this issue Mar 15, 2022 · 5 comments

Comments

@leosin
Copy link

leosin commented Mar 15, 2022

Error [ERR_REQUIRE_ESM]: require() of ES Module

import Slugify from '@sindresorhus/slugify'

image

node_modules/@sindresorhus/slugify/index.js from .../vite.config.ts not supported.

Am I doing something wrong?

https://github.com/jeremys/uslug

i use this plugin is ok
slugify: (s: string) => uslug(s),

@sindresorhus
Copy link
Owner

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

@leosin
Copy link
Author

leosin commented Mar 16, 2022

Thank you very much, I will read it carefully

@krazyjakee
Copy link

but this doesn't actually resolve the issue. This is a library that could be used in .js configurations which cannot be configured to run like a module or be precompiled. I work with thousands of npm libraries, this is the only one which stubbornly misunderstands the current ecosystem.

@lud
Copy link

lud commented Nov 15, 2022

Can this be used with eleventy?

@nezort11
Copy link

Just use this package https://github.com/simov/slugify instead of this, same API. it's not worth all the hassle with ESM modules for a single package

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

No branches or pull requests

5 participants