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

ERR_REQUIRE_ESM #398

Closed
louwers opened this issue Jul 7, 2024 · 3 comments · Fixed by #407
Closed

ERR_REQUIRE_ESM #398

louwers opened this issue Jul 7, 2024 · 3 comments · Fixed by #407
Labels

Comments

@louwers
Copy link

louwers commented Jul 7, 2024

When I try to use GeoStyler with npx geostyler-cli I get the following message:

/Users/bart/.npm/_npx/d2b78a7bedb6eda9/node_modules/geostyler-cli/dist/src/index.js:17
const geostyler_qgis_parser_1 = __importDefault(require("geostyler-qgis-parser"));
                                                ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/bart/.npm/_npx/d2b78a7bedb6eda9/node_modules/geostyler-qgis-parser/dist/QGISStyleParser.js from /Users/bart/.npm/_npx/d2b78a7bedb6eda9/node_modules/geostyler-cli/dist/src/index.js not supported.
Instead change the require of QGISStyleParser.js in /Users/bart/.npm/_npx/d2b78a7bedb6eda9/node_modules/geostyler-cli/dist/src/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/bart/.npm/_npx/d2b78a7bedb6eda9/node_modules/geostyler-cli/dist/src/index.js:17:49) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v22.1.0

Wat are the supported Node versions?

@KaiVolland
Copy link
Contributor

Hey @louwers,

unfortunatley there was an unintended minor release of the qgis parser v2.1.0 that included a breaking change on bundling level.

For now I'm afraid you would have to check out this repository and pin the qgis version parser version to 2.0.1.

Once the geostyler-mapfile-parser is moved to ES modules and released we can alos update the command line interface and upgrade all parsers to their latest versions.

I hope we can solve this today or at least this week.

@ahocevar
Copy link
Contributor

#407 fixes this.

@jansule
Copy link
Contributor

jansule commented Oct 7, 2024

🎉 This issue has been resolved in version 4.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

4 participants