-
-
Notifications
You must be signed in to change notification settings - Fork 39
Labels
bugSomething isn't workingSomething isn't working
Description
My understanding of NodeJS is quite limited, so bear with me.
I am not able to even import geostyler-sld-parser. Consider this one line file importsld.mjs:
import SldParser from 'geostyler-sld-parser';For geostyler-sld-parser newer than 6.0 (when it changed to ESM), it fails as shown below. For older versions it imports without issue.
According to my chatbot, its because of this line, in SldStyleParser.js:
import { geoStylerFunctionToSldFunction, get, getAttribute, getBase64Object, getChildren, getParameterValue, getVendorOptionValue, isSymbolizer, keysByValue, numberExpression } from './Util/SldUtil';It should be from './Util/SldUtil.js'. But if thats the case, then why has nobody else reported this since version 6.0? Maybe Im not even supposed to import like this?
Error demonstration and output:
$ npm install geostyler-sld-parser@5 -s
$ node importsld.mjs
$ npm install geostyler-sld-parser@8 -s
$ node importsld.mjs
node:internal/modules/esm/resolve:274
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/velle/a/gadelys-styling/node_modules/geostyler-sld-parser/dist/Util/SldUtil' imported from /home/velle/a/gadelys-styling/node_modules/geostyler-sld-parser/dist/SldStyleParser.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:717:20)
at ModuleLoader.resolve (node:internal/modules/esm/loader:694:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:308:38)
at ModuleJob._link (node:internal/modules/esm/module_job:183:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///home/velle/a/gadelys-styling/node_modules/geostyler-sld-parser/dist/Util/SldUtil'
}
Node.js v22.19.0Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working