op-energy-foundation / op-energy-blockspan-service

0 stars 0 forks source link

swagger ui do not shows error body for 4xx return codes #29

Closed dambaev closed 4 months ago

dambaev commented 4 months ago

so when I am trying to update swagger ui, css loader says this:

./node_modules/swagger-ui-dist/swagger-ui.css.webpack[javascript/auto]!=!./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/swagger-ui-dist/swagger-ui.css - Error: Module Error (from ./node_modules/postcss-loader/dist/cjs.js):
<css input>:17:12: Can't resolve '"data:image/svg+xml;charset=utf-8,<svg xmlns=/"http://www.w3.org/2000/svg/" width=/"16/" height=/"15/" aria-hidden=/"true/"><path fill=/"%23fff/" fill-rule=/"evenodd/" d=/"M4 12h4v1H4zm5-6H4v1h5zm2 3V7l-3 3 3 3v-2h5V9zM6.5 8H4v1h2.5zM4 11h2.5v-1H4zm9 1h1v2c-.02.28-.11.52-.3.7s-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2s2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10zM4 4h8c0-.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1/"/></svg>"' in '/data/devel/nixos/op-energy-blockspan-service/frontend/node_modules/swagger-ui-dist'

which probably means, that we need to update some other dependency. Maybe postcss-loader

UPDATE: postcss-loader update does not solve this error

dambaev commented 4 months ago

I had tried to update:

but looks like at this point we need to update angular as it complains now that it was not able to find webpack module. Update of angular is not a fast task, so we need to decide what to do next:

  1. try to update angular to get it working with new version of webpack;
  2. try to hack current version of swagger to behave with 4xx return codes as with 5xx (with which it shows error body properly). @tphyahoo

@Natsvora : maybe you can check this branch and will see that I do something obvious for angular developer