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

UF broken with latest 2023.02.00-RC1-geOrchestra #182

Closed
jusabatier opened this issue Jul 5, 2023 · 21 comments · Fixed by #184
Closed

UF broken with latest 2023.02.00-RC1-geOrchestra #182

jusabatier opened this issue Jul 5, 2023 · 21 comments · Fixed by #184

Comments

@jusabatier
Copy link
Collaborator

Since we deploy the latest 2023.02.00-RC1-geOrchestra, when trying to interrogate a land unit (Unité Foncière), it result in an error message "Oups, quelque chose a mal tourné..." (Oops, something went wrong...).

In console logs we have :

TypeError: e.tileMatrixSet.filter is not a function
    at Object.P (289.0af9bccd.js:1:223100)
    at Object.R [as create] (map-library-openlayers-js.d701841c.js:1:182635)
    at Object.a [as createLayer] (289.0af9bccd.js:1:244111)
    at u.createLayer (map-library-openlayers-js.d701841c.js:1:48956)
    at u.value (map-library-openlayers-js.d701841c.js:1:52374)
    at Ol (geOrchestra.js?5f38512cef2803e9bc4a:2:3543098)
    at t.unstable_runWithPriority (geOrchestra.js?5f38512cef2803e9bc4a:2:4527812)
    at zi (geOrchestra.js?5f38512cef2803e9bc4a:2:3488589)
    at Cl (geOrchestra.js?5f38512cef2803e9bc4a:2:3539657)
    at ul (geOrchestra.js?5f38512cef2803e9bc4a:2:3529764)
    at geOrchestra.js?5f38512cef2803e9bc4a:2:3488880
    at t.unstable_runWithPriority (geOrchestra.js?5f38512cef2803e9bc4a:2:4527812)
    at zi (geOrchestra.js?5f38512cef2803e9bc4a:2:3488589)
    at Vi (geOrchestra.js?5f38512cef2803e9bc4a:2:3488825)
    at Wi (geOrchestra.js?5f38512cef2803e9bc4a:2:3488760)
    at il (geOrchestra.js?5f38512cef2803e9bc4a:2:3526263)

Can someone reproduce this bug ?

@MaelREBOUX @catmorales @pierrejego @landryb @tdipisa

@catmorales
Copy link

we are on an old release of georchestra

@jusabatier
Copy link
Collaborator Author

jusabatier commented Jul 5, 2023

@catmorales 2023.02.00-RC1-geOrchestra is the latest mapstore2-georchestra's release

Don't you plan to test it in order to validate MS2 delivery ?

@catmorales
Copy link

catmorales commented Jul 5, 2023

oh sorry, I get distracted. Yes we plan to deploy 2023.02.00-RC1-geOrchestra when I will back (week 30). It's scheduled for the july 26th. I will on holiday tomorrow

@tdipisa
Copy link
Collaborator

tdipisa commented Jul 17, 2023

@jusabatier we will double check this as part of the RC2 work. Thank you.

@dsuren1
Copy link
Collaborator

dsuren1 commented Jul 26, 2023

@jusabatier
I'm unable to reproduce this issue in https://georchestra.geo-solutions.it/mapstore/#/context/CadastrappUrbanisme which has latest version(2023.02.00-RC1-geOrchestra) and the context has cadastrapp extension in it.

Could you please provide more info to reproduce it. Perhaps export the map json.

Image

@jusabatier
Copy link
Collaborator Author

You can access a context with this bug here : https://geoportail.lepuyenvelay.fr/mapstore/#/context/Cadastre

The export function is enabled so you can also get the map.json

@dsuren1
Copy link
Collaborator

dsuren1 commented Jul 26, 2023

@jusabatier
The extension are built with old version of MS and it needs to be updated to version equivalent to geOrchestra RC's MS submodule version and has to be rebuilt and imported back to context again. Doing this should solve the issue.

@jusabatier
Copy link
Collaborator Author

I confirm it solve the problem.

I simply change the Mapstore2 submodule to v2023.01.02 and recompile the extension, and it solve the problem after upgrade mapstore2-cadastrapp extention in Mapstore2 with the generated Zip.

Maybe someone with write acces can update the Mapsore2 submodule to v2023.01.02 and release it ?

@landryb
Copy link
Member

landryb commented Jul 26, 2023

maybe the submodule should just point at the same commit as the MapStore2 submodule in ms2-georchestra ?

@dsuren1
Copy link
Collaborator

dsuren1 commented Jul 27, 2023

Yes correct

@jusabatier
Copy link
Collaborator Author

If you do so, what commit will you use ? The one from master or from the release ?

I think we should use a release tag commit for releasing a module version.

Also for the versioning of the module, shouldn't it embed the georchestra-mapstore or the mapstore release version ?
This way we know with which version of mapstore it should be used.

@Gaetanbrl
Copy link

Gaetanbrl commented Jul 27, 2023

Also for the versioning of the module, shouldn't it embed the georchestra-mapstore or the mapstore release version ?

MS2 is always embed in a module (depend of developper). So, on start you have to update mapstore2 submodule all the time and build if needed :

git clone --recursive http://my.module.repo.git
cd my.module.dir
nvm use {node_js_version}
git submodule update
npm install
npm run build

Refs :

ref geosolutions-it/MapStoreExtension#57
ref geosolutions-it/MapStoreExtension#46


If you do so, what commit will you use ? The one from master or from the release ?

Normally, for mapstore2-georchestra, we have to use near MapStore2 versions between MapStore2-georchestra and mapstore2 module version.

Refs :

ref https://github.com/geosolutions-it/MapStoreExtension#compatibility

So i guess this depend if module have to works in latest (so align and fix module with latest MS2 version) or / and works with master (so align and fix module with master ms2 version).

@landryb
Copy link
Member

landryb commented Aug 10, 2023

fwiw, trying to update the submodule to point at the latest from ms2-geor 2023.02rc2, here's what i did so far:

[10/08 15:00] [email protected]:/data/src/georchestra/mapstore2-cadastrapp/MapStore2 $git fetch
[10/08 15:00] [email protected]:/data/src/georchestra/mapstore2-cadastrapp/MapStore2 $git checkout c4f94e3b7b
Updating files: 100% (1656/1656), done.
Previous HEAD position was 223b0f6ee Porting changes from #7881 partially to make standard print option configurable from localConfig/context. (#8205)
HEAD is now at c4f94e3b7 #9314: Fix - Enhance show/hide attribute edit option on Layer (#9317)
[10/08 15:00] [email protected]:/data/src/georchestra/mapstore2-cadastrapp/MapStore2 $cd ..
[10/08 15:00] [email protected]:/data/src/georchestra/mapstore2-cadastrapp $rm -f package-lock.json && npm install && npm run ext:build

but so far it utterly fails to build:

ERROR in ./node_modules/@cesium/engine/Source/Core/Resource.js 2043:30-44
Module not found: Error: Can't resolve 'zlib' in '/data/src/georchestra/mapstore2-cadastrapp/node_modules/@cesium/engine/Source/Core'
ERROR in ./node_modules/@cesium/engine/Source/Core/Resource.js 2050:39-54
Module not found: Error: Can't resolve 'https' in '/data/src/georchestra/mapstore2-cadastrapp/node_modules/@cesium/engine/Source/Core'
ERROR in ./node_modules/@cesium/engine/Source/Core/Resource.js 2050:57-71
Module not found: Error: Can't resolve 'http' in '/data/src/georchestra/mapstore2-cadastrapp/node_modules/@cesium/engine/Source/Core'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
        - install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "http": false }

because from what i understand the version of cesium that is in node_modules is 1.90 while the version in MapStore2/node_modules is 1.106.1:

$grep _id node_modules/cesium/package.json MapStore2/node_modules/cesium/package.json
node_modules/cesium/package.json:  "_id": "[email protected]",
MapStore2/node_modules/cesium/package.json:  "_id": "[email protected]",

dunno if that's related to that failure... and if so, should package.json be updated ?

i've tried adding

"cesium": "1.106.1"

to package.json but that doesnt solve the build failure. maybe because of npm6/nodejs12 ?

@landryb
Copy link
Member

landryb commented Aug 10, 2023

i think i found it, probably need geosolutions-it/MapStore2@0e85f94#diff-e1b4f6050534d4d47c8f8720d3dce199f10cf3e40c6931a303bf1b11ad411a42L190 to be adapted for this project.

@jusabatier
Copy link
Collaborator Author

Here, I did this :

cd mapstore2-cadastrapp
git submodule update --init --recursive
cd MapStore2
git checkout v2023.01.02
cd ..
npm run ext:build => complains about missing mkdirp
npm install --save --legacy-peer-deps mkdirp
npm run ext:build => complains about https protocol
export NODE_OPTIONS=--openssl-legacy-provider
npm run ext:build

And I finally success building the addon.

NPM version : 9.8.0
NodeJS version : 18.17.0

@landryb
Copy link
Member

landryb commented Aug 10, 2023

i have this as a local diff:

diff --git a/MapStore2 b/MapStore2
index 223b0f6..c4f94e3 160000
--- a/MapStore2
+++ b/MapStore2
@@ -1 +1 @@
-Subproject commit 223b0f6eec5c5c614a4ad21a318ae35370e3f402
+Subproject commit c4f94e3b7bfd22eaf94e22aebf6d9f1b09a61b6f
diff --git a/webpack.config.js b/webpack.config.js
index 12df863..4026ca2 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -34,6 +34,6 @@ const cfg = buildConfig(
     proxyConfig
 );
 // stream are needed here in code
-cfg.resolve.fallback = {timers: false};
+cfg.resolve.fallback = {timers: false, http: false, https: false, zlib: false}
 cfg.devtool = "eval-source-map";
 module.exports = cfg;

but it still fails.

now, with node v18.17.1 & npm v9.6.7 installed via nvm install --lts:

[10/08 16:14] [email protected]:/data/src/georchestra/mapstore2-cadastrapp $npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"7.8.1" from the root project
npm ERR!   peer eslint@">= 7.5.0" from @mapstore/[email protected]
npm ERR!   node_modules/@mapstore/eslint-config-mapstore
npm ERR!     dev @mapstore/eslint-config-mapstore@"1.0.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"2.x - 6.x" from [email protected]
npm ERR! node_modules/eslint-plugin-import
npm ERR!   dev eslint-plugin-import@"2.20.2" from the root project
npm ERR!   peer eslint-plugin-import@">= 2.20.2" from @mapstore/[email protected]
npm ERR!   node_modules/@mapstore/eslint-config-mapstore
npm ERR!     dev @mapstore/eslint-config-mapstore@"1.0.3" from the root project

that nodejs ecosystem is just a joke.

@jusabatier
Copy link
Collaborator Author

Try with :

npm install --save --legacy-peer-deps

@landryb
Copy link
Member

landryb commented Aug 10, 2023

ok, got it finally building with this diff in the MapStore2 submodule:

diff --git a/build/createExtensionWebpackConfig.js b/build/createExtensionWebpackConfig.js
index fbab8b223..c83af1fb2 100644
--- a/build/createExtensionWebpackConfig.js
+++ b/build/createExtensionWebpackConfig.js
@@ -35,6 +35,9 @@ module.exports = ({ prod = true, name, exposes, sharedLibrariesEager = true, ali
     resolve: {
         fallback: {
             path: false,
+            http: false,
+            https: false,
+            zlib: false,
             timers: false,
             stream: false
         },

@dsuren1 @offtherailz does that make sense to you ? i guess build/createExtensionWebpackConfig.js is used when building an external extension like cadastrapp here.. since you added those bits to the other webpack configs in geosolutions-it/MapStore2#9267 ...

with only this diff on top of geosolutions-it/MapStore2@c4f94e3b7bf i've been able to build dist/Cadastrapp.zip with node v12.22.12 / npm 6.14.16

@landryb
Copy link
Member

landryb commented Aug 10, 2023

i can confirm the resulting Cadastrapp.zip build fixes the original issue (broken UF query), running inside 2023.02rc2

landryb added a commit to landryb/MapStore2 that referenced this issue Aug 31, 2023
…ild config

follows what was done in e9e3883 for other webpack build configs
fixes external extension building after cesium update in geosolutions-it#9267
cf georchestra/mapstore2-cadastrapp#182
allyoucanmap pushed a commit to geosolutions-it/MapStore2 that referenced this issue Sep 11, 2023
…ild config (#9375)

follows what was done in e9e3883 for other webpack build configs
fixes external extension building after cesium update in #9267
cf georchestra/mapstore2-cadastrapp#182
landryb added a commit to landryb/MapStore2 that referenced this issue Sep 14, 2023
…ild config (geosolutions-it#9375)

follows what was done in e9e3883 for other webpack build configs
fixes external extension building after cesium update in geosolutions-it#9267
cf georchestra/mapstore2-cadastrapp#182
tdipisa pushed a commit to geosolutions-it/MapStore2 that referenced this issue Sep 14, 2023
…ild config (#9375) (#9445)

follows what was done in e9e3883 for other webpack build configs
fixes external extension building after cesium update in #9267
cf georchestra/mapstore2-cadastrapp#182
@landryb
Copy link
Member

landryb commented Sep 29, 2023

@dsuren1 @tdipisa to get a working cadastrapp build, should/can i do a PR updating the MS2 submodule like georchestra/mapstore2-georchestra#653 or you plan to do it as part of contract #4 ? we can do the PR/release, just want to make sure where's the limit of what you are contracted for...

afaict the last commit tagged v2.0.0 in https://github.com/georchestra/mapstore2-cadastrapp/releases/tag/v2.0.0 by @MaelREBOUX wont work on 2023.02.

cc @catmorales @jusabatier

landryb added a commit to landryb/mapstore2-cadastrapp that referenced this issue Oct 3, 2023
landryb added a commit that referenced this issue Oct 12, 2023
* Update MS2 submodule to 2023.02.00

should fix #182

* update to geosolutions-it/MapStore2@b81c200 (tip of 2023.02.xx branch)
@landryb
Copy link
Member

landryb commented Oct 12, 2023

just made a v2.1.0 release of the extension in https://github.com/georchestra/mapstore2-cadastrapp/releases/tag/v2.1.0 - the Cadastrapp-v2.1.0.zip asset was taken from https://github.com/georchestra/mapstore2-cadastrapp/actions/runs/6495176530 but those expire quite fast so this way it's kept available...

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

Successfully merging a pull request may close this issue.

6 participants