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: Cannot find module 'escape-string-regexp' when using this package #56

Closed
robkorv opened this issue Apr 8, 2024 · 1 comment · Fixed by #57
Closed

Error: Cannot find module 'escape-string-regexp' when using this package #56

robkorv opened this issue Apr 8, 2024 · 1 comment · Fixed by #57
Assignees

Comments

@robkorv
Copy link
Owner

robkorv commented Apr 8, 2024

I think this needs to be in the peerDependencies?

@robkorv robkorv self-assigned this Apr 8, 2024
@robkorv
Copy link
Owner Author

robkorv commented Apr 8, 2024

Different plan. Going to use https://github.com/tc39/proposal-regex-escaping/blob/3d45b23af8e8824dd689deb35856a80fa52d78ca/polyfill.js to fix the build error when using require("escape-string-regexp")

# /home/runner/work/postcss-selector-prefix/postcss-selector-prefix/index.js:4
# const escapeStringRegexp = require("escape-string-regexp");
#                            ^
# Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/postcss-selector-prefix/postcss-selector-prefix/node_modules/escape-string-regexp/index.js from /home/runner/work/postcss-selector-prefix/postcss-selector-prefix/index.js not supported.
# Instead change the require of /home/runner/work/postcss-selector-prefix/postcss-selector-prefix/node_modules/escape-string-regexp/index.js in /home/runner/work/postcss-selector-prefix/postcss-selector-prefix/index.js to a dynamic import() which is available in all CommonJS modules.
#     at Object.<anonymous> (/home/runner/work/postcss-selector-prefix/postcss-selector-prefix/index.js:4:28)
#     at Object.<anonymous> (/home/runner/work/postcss-selector-prefix/postcss-selector-prefix/index.test.js:5:16) {
#   code: 'ERR_REQUIRE_ESM'
# }

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