georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

Issue with dev mode #568

Open fgravin opened 2 years ago

fgravin commented 2 years ago

As a developer, I would like to help debugging some issue, but honestly, the experience is always hurting. There is no real doc on how to setup a development environment.

My usecase: npm v12.21.0

npm install npm start There are error[1] in the start but whatever it runs

I try to debug the catalog service loading (CSW), no way to find any file in the devtools (CatalogServiceEditor for instance), while the prod is set to false.

Screenshot from 2022-10-28 13-54-57

I want the sourcemap as well, so I hacked the webpack config with devtool: 'source-map' but I guess something is broken in the build ? It seems to be running in production mode whatever we do.

Would appreciate if the Mapstore team could provide their lights on this topic and give best practices on how to set up a correct dev env. Thanks a lot to the team !

[1]

ERROR in ./MapStore2/web/client/components/misc/enhancers/utcDateWrapper.js 35:2
Module parse failed: Unexpected token (35:2)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|   } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|   return compose(withPropsOnChange([dateProp], _ref /* props */
>   => {
|     let {
|       [dateProp]: date,
 @ ./MapStore2/web/client/components/data/query/DateField.jsx 14:0-65 24:26-40
 @ ./MapStore2/web/client/components/data/query/GroupField.jsx 16:0-36 136:43-52 140:43-52 148:43-52
 @ ./MapStore2/web/client/components/styleeditor/FilterBuilder.jsx 10:0-50 67:38-48
 @ ./MapStore2/web/client/components/styleeditor/RulesEditor.jsx 18:0-55 315:43-63
 @ ./MapStore2/web/client/components/styleeditor/VisualStyleEditor.jsx 16:0-67 290:42-53
 @ ./MapStore2/web/client/plugins/styleeditor/StyleCodeEditor.jsx 24:0-79 63:3-20
 @ ./MapStore2/web/client/plugins/styleeditor/index.js 28:0-52 29:31-50
 @ ./MapStore2/web/client/plugins/StyleEditor.jsx 27:0-83 40:42-54 48:63-78 50:42-55 205:24-36
 @ ./MapStore2/web/client/product/plugins.js 144:51-129
 @ ./js/plugins.js 9:0-55 21:19-41 23:12-34 31:12-35
 @ ./js/app.jsx 12:0-32 136:7-22 141:12-28
Gaetanbrl commented 2 years ago

@fgravin some issues / post about dev :

https://groups.google.com/g/georchestra-dev/c/fh9qJZQZKSA

https://github.com/georchestra/mapstore2-georchestra/issues/398

https://github.com/georchestra/mapstore2-georchestra/issues/545

landryb commented 1 year ago

@fgravin: fwiw, iirc to get the unminified source for the frontend you need http://localhost:8081/?debug=true. the tomcat backend is running on port 8080, and afaict webpack/nodejs is running on port 8081:

            � 「wds」: Project is running at http://localhost:8081/
[frontend] �
            � 「wds」: webpack output is served from /dist/
[frontend] �
            � 「wds」: Content not from webpack is served from web/client

its in the doc here: https://docs.mapstore.geosolutionsgroup.com/en/latest/developer-guide/developing/#redux-dev-tools but i agree i've also been confused :)