hslayers / hslayers-ng

User interface and map building extensions for OpenLayers
https://ng.hslayers.org/
MIT License
37 stars 20 forks source link

hslayers-server does not run in Node 22 #5413

Closed jmacura closed 2 weeks ago

jmacura commented 2 weeks ago

Bug

Describe the bug

import packageJson from './package.json' assert { type: 'json'};
                                         ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:340:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
    at #translate (node:internal/modules/esm/loader:433:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:480:27)
    at async ModuleJob._link (node:internal/modules/esm/module_job:112:19)

Node.js v22.11.0

To Reproduce Steps to reproduce the behavior:

  1. Run npm run proxy on Node >= 22

Expected behavior hslayers-server starts

Screenshots see code above

Additional context Fix will break builds on Node < 18. See https://stackoverflow.com/questions/78876691/syntaxerror-unexpected-identifier-assert-on-json-import-in-node-v22

bvj commented 1 week ago

V repozitáři je nejvyšší verze 20. Pokud je potřeba 22, tak jí mohu instalovat z Nodesource, nebo zkusit počkat - měla by se v repu objevit.