geostyler / geostyler-cli

BSD 2-Clause "Simplified" License
24 stars 9 forks source link

ERR_REQUIRE_ESM #398

Closed louwers closed 2 weeks ago

louwers commented 3 months ago

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 commented 3 months ago

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 commented 2 weeks ago

407 fixes this.

jansule commented 22 hours ago

:tada: This issue has been resolved in version 4.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: