georchestra / mapstore2-cadastrapp

repository for the mapstore2 version of cadastrapp
GNU General Public License v3.0
2 stars 10 forks source link

build failure on master #167

Open landryb opened 2 years ago

landryb commented 2 years ago

following the regular 'npm install && npm run ext:build` steps, building master fails here:

assets by status 14.9 MiB [cached] 29 assets
orphan modules 25.6 MiB [orphan] 2889 modules
runtime modules 23.3 KiB 18 modules
code generated modules 39.7 MiB (javascript) 51.7 KiB (css/mini-extract) 378 bytes (share-init) 378 bytes (consume-shared) [code generated]
  modules by path ./node_modules/ 25.8 MiB (javascript) 34.5 KiB (css/mini-extract)
    javascript modules 25.7 MiB 2116 modules
    css modules 34.5 KiB 16 modules
    json modules 76.8 KiB 2 modules
  modules by path ./MapStore2/ 13.1 MiB (javascript) 3.89 KiB (css/mini-extract)
    modules by path ./MapStore2/node_modules/ 11.7 MiB 357 modules
    modules by path ./MapStore2/web/client/ 1.38 MiB (javascript) 3.89 KiB (css/mini-extract) 129 modules
  provide-module modules 378 bytes 9 modules
  consume-shared-module modules 378 bytes 9 modules
  modules by path ./js/extension/ 792 KiB (javascript) 13.3 KiB (css/mini-extract)
    cacheable modules 792 KiB 2 modules
    css modules 13.3 KiB 2 modules

ERROR in ./MapStore2/web/client/components/map/cesium/Map.jsx 65:0-26
Module not found: Error: Can't resolve '/data/src/georchestra/mapstore2-cadastrapp/node_modules/cesium/Build/Cesium/Widgets/widgets.css' in '/data/src/georchestra/mapstore2-cadastrapp/MapStore2/web/client/components/map/cesium'
 @ ./MapStore2/web/client/components/map/plugins/cesium.js
 @ ./MapStore2/web/client/components/map/plugins/ lazy ^\.\/.*\.js$ chunkName: map-library-[request] namespace object ./cesium.js
 @ ./MapStore2/web/client/components/map/enhancers/mapType.js 93:10-95:48
 @ ./MapStore2/web/client/components/widgets/widget/MapView.jsx 13:0-50 18:93-100
 @ ./js/extension/components/landedproperty/MapView.jsx 9:0-66 27:27-34
 @ ./js/extension/components/landedproperty/Content.jsx 8:0-32 55:38-45
 @ ./js/extension/components/landedproperty/Modal.jsx 27:0-32 181:38-45
 @ ./js/extension/plugins/cadastrapp/LandedProperty.jsx 23:0-83 69:42-72
 @ ./js/extension/plugins/cadastrapp/Main.jsx 11:0-46 52:194-208
 @ ./js/extension/plugins/Extension.jsx 6:0-37 49:13-17
 @ container entry

ERROR in ./js/extension/plugins/cadastrapp/Main.jsx 14:0-61
Module not found: Error: Can't resolve 'react-container-dimensions' in '/data/src/georchestra/mapstore2-cadastrapp/js/extension/plugins/cadastrapp'
 @ ./js/extension/plugins/Extension.jsx 6:0-37 49:13-17
 @ container entry

webpack 5.9.0 compiled with 2 errors in 264980 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! CadastrappExtension@1.0.0 ext:build: `rimraf ./dist && mkdirp ./dist && webpack --progress  --color --config build/extension/prod-webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the CadastrappExtension@1.0.0 ext:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/landry/.npm/_logs/2022-06-21T15_14_30_933Z-debug.log

i've tried npm install in the Mapstore2 submodule but that doesnt help.

i dont have a node_modules/cesium/ subdir in the toplevel node_modules folder.

Gaetanbrl commented 2 years ago

tested with node 12.16.1 and npm 6.13.4 ==> OK

nvm install 12.16.1
git clone --recursive https://github.com/georchestra/mapstore2-cadastrapp
cd mapstore2-cadastrapp
npm install
npm run ext:build

============

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  assets/img/node_modules/leaflet-extra-markers/dist/img/markers_default@2x0e04541b6ebe474c81733ab05f85b891.png (248 KiB)
  index.js (429 KiB)
  assets/js/289.19783918.js (574 KiB)
  assets/js/275.59bd00e2.js (639 KiB)
  assets/js/469.ab5abcec.js (283 KiB)
  assets/js/965.283b8a30.js (3.81 MiB)
  assets/js/86.e7a40fb5.js (1.49 MiB)
  assets/js/985.983c8d9e.js (2.19 MiB)
  assets/js/807.8c45f492.js (368 KiB)
  assets/js/455.c2f7427b.js (361 KiB)
  Cadastrapp.zip (2.91 MiB)

webpack 5.9.0 compiled with 3 warnings in 102501 ms
landryb commented 2 years ago

npm 6.14.16, nodejs 12.22.12-deb-1nodesource1 - and exact same failure after removing both node_modules subdirs.

[22/06 07:45] landry@build.fluela:/data/src/georchestra/mapstore2-cadastrapp $rm -Rf node_modules MapStore2/node_modules
[22/06 07:45] landry@build.fluela:/data/src/georchestra/mapstore2-cadastrapp $npm install && npm run ext:build
....
ERROR in ./MapStore2/web/client/components/map/cesium/Map.jsx 65:0-26
Module not found: Error: Can't resolve '/data/src/georchestra/mapstore2-cadastrapp/node_modules/cesium/Build/Cesium/Widgets/widgets.css' in '/data/src/georchestra/mapstore2-cadastrapp/MapStore2/web/client/components/map/cesium'
 @ ./MapStore2/web/client/components/map/plugins/cesium.js
 @ ./MapStore2/web/client/components/map/plugins/ lazy ^\.\/.*\.js$ chunkName: map-library-[request] namespace object ./cesium.js
 @ ./MapStore2/web/client/components/map/enhancers/mapType.js 93:10-95:48
 @ ./MapStore2/web/client/components/widgets/widget/MapView.jsx 13:0-50 18:93-100
 @ ./js/extension/components/landedproperty/MapView.jsx 9:0-66 27:27-34
 @ ./js/extension/components/landedproperty/Content.jsx 8:0-32 55:38-45
 @ ./js/extension/components/landedproperty/Modal.jsx 27:0-32 181:38-45
 @ ./js/extension/plugins/cadastrapp/LandedProperty.jsx 23:0-83 69:42-72
 @ ./js/extension/plugins/cadastrapp/Main.jsx 11:0-46 52:194-208
 @ ./js/extension/plugins/Extension.jsx 6:0-37 49:13-17
 @ container entry

ERROR in ./js/extension/plugins/cadastrapp/Main.jsx 14:0-61
Module not found: Error: Can't resolve 'react-container-dimensions' in '/data/src/georchestra/mapstore2-cadastrapp/js/extension/plugins/cadastrapp'
 @ ./js/extension/plugins/Extension.jsx 6:0-37 49:13-17
 @ container entry

webpack 5.9.0 compiled with 2 errors in 266291 ms

i still have no node_modules/cesium subdir, but i have Mapstore2/node_modules/cesium. same thing for react-container-dimension, absent in node_modules but present in Mapstore2/node_modules.

i copied those over:

[22/06 07:54] landry@build.fluela:/data/src/georchestra/mapstore2-cadastrapp $cp -r MapStore2/node_modules/cesium node_modules
[22/06 07:55] landry@build.fluela:/data/src/georchestra/mapstore2-cadastrapp $cp -r MapStore2/node_modules/react-container-dimensions node_modules/

noted that they're removed if i rerun npm install, recopied them again.

and with that it finally built:

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  assets/img/node_modules/leaflet-extra-markers/dist/img/markers_default@2x0e04541b6ebe474c81733ab05f85b891.png (248 KiB)
  index.js (429 KiB)
  assets/js/289.f0adc163.js (568 KiB)
  assets/js/275.173f60bc.js (639 KiB)
  assets/js/469.72d63229.js (282 KiB)
  assets/js/913.454ab2b8.js (7.46 MiB)
  assets/js/412.0121675f.js (1.54 MiB)
  assets/js/985.cd57ea10.js (2.19 MiB)
  assets/js/807.8eef8b70.js (368 KiB)
  Cadastrapp.zip (3.86 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  Cadastrapp (429 KiB)
      index.js

webpack 5.9.0 compiled with 2 warnings in 264076 ms

so from my understanding, some dependencies in the toplevel node_modules dir arent installed, and they're not found via the node_modules/mapstore2 symlink.

lrwxrwxrwx 1 landry users 12 Jun 22 07:47 node_modules/mapstore2 -> ../MapStore2
MV88 commented 2 years ago

Hello, @landryb

after removing both node_modules subdirs.

Maybe the problem is on the package-lock.json try to remove it aswell with node_modules, and try again

landryb commented 2 years ago

yes, it's fine after removing package-lock.json. Maybe npm install should regenerate it ? or the docs should mention in the build docs that one should remove it after each git pull ? since it's in .gitignore ppl who are not nodejs developers might not know about it.

Gaetanbrl commented 2 years ago

npm doc explain :

package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json

But from my experiences, i need to destroy him if i change github ref (e.g change branch) to be sur to build last dependancies.

the docs should mention in the build docs that one should remove it after each git pull

True for me