Open grossmj opened 2 years ago
It works after adding --build-optimizer=false
to the build command line.
$ ng build --source-map=false --build-optimizer=false --configuration=production --base-href /static/web-ui/
✔ Browser application bundle generation complete.
✔ Copying assets complete.
⠋ Generating index html...1 rules skipped due to selector errors:
legend+* -> Cannot read properties of undefined (reading 'type')
✔ Index html generation complete.
Initial Chunk Files | Names | Raw Size | Estimated Transfer Size
main.6c2c5909222aa3d2.js | main | 4.10 MB | 728.21 kB
styles.1035ff77d963da68.css | styles | 372.99 kB | 27.86 kB
polyfills.7e7f4a715088fcc2.js | polyfills | 37.38 kB | 11.67 kB
runtime.b694e7eebb80e122.js | runtime | 3.32 kB | 1.42 kB
| Initial Total | 4.50 MB | 769.15 kB
Lazy Chunk Files | Names | Raw Size | Estimated Transfer Size
465.1c1bfd214c8e7f59.js | topology-summary-topology-summary-component | 13.50 kB | 3.28 kB
Build at: 2022-07-28T09:23:54.862Z - Hash: 6730b2d6b3b5e280 - Time: 100894ms
./node_modules/bootstrap/dist/css/bootstrap.min.css.webpack[javascript/auto]!=!./node_modules/@angular-devkit/build-angular/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[2]!./node_modules/bootstrap/dist/css/bootstrap.min.css - Warning: Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning
(6:29521) autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
Done in 103.34s.
So now need to understand what is this optimizer and if we need it?
Also, need to investigate these 2 errors/warnings:
⠋ Generating index html...1 rules skipped due to selector errors:
legend+* -> Cannot read properties of undefined (reading 'type')
./node_modules/bootstrap/dist/css/bootstrap.min.css.webpack[javascript/auto]!=!./node_modules/@angular-devkit/build-angular/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[2]!./node_modules/bootstrap/dist/css/bootstrap.min.css - Warning: Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning
The last one seems to be a consequence of deactivating --build-optimizer=false
...
We use this script to bundle the web-ui in the GNS3 server: https://github.com/GNS3/gns3-server/blob/3.0/scripts/update-bundled-web-ui.sh
However nothing can be seen when opening a browser to point to the server IP/port. I can see some .js and .css files are sent from the server but nothing is displayed. This works when bundling v2 of the web-ui, so I am definitely suspecting something is wrong with v3.
I have also tried to manually deploy and running a small http server in the web-ui repo directly:
This is the same result, files are served by the HTTP server but nothing is displayed in the browser. The only "error" I can see when building is this one, maybe that's the reason?