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

Angular build failed #8116

Closed
thusharalk opened this issue Jul 22, 2022 · 4 comments
Closed

Angular build failed #8116

thusharalk opened this issue Jul 22, 2022 · 4 comments

Comments

@thusharalk
Copy link

ERROR in ./node_modules/swagger-ui-dist/swagger-ui.css
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleError: Module Error (from ./node_modules/postcss-loader/src/index.js):
(Emitted value instead of an instance of Error) CssSyntaxError: webpack://swagger-ui/src/style/_models.scss:130:12: Can't resolve '%22data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns=/%22http://www.w3.org/2000/svg/%22%20viewBox=/%220%200%2020%2020/%22%3E%3Cpath%20d=/%22M13.418%207.859a.695.695%200%200%201%20.978%200%20.68.68%200%200%201%200%20.969l-3.908%203.83a.697.697%200%200%201-.979%200l-3.908-3.83a.68.68%200%200%201%200-.969.695.695%200%200%201%20.978%200L10%2011l3.418-3.141z/%22/%3E%3C/svg%3E%22' in 'D:\atsuke-marketplace-app\node_modules\swagger-ui-dist'

@nspire909
Copy link

I am seeing basically the same thing in my repo. Comparing the swagger-ui.css in swagger-ui-dist from version 4.12.0 to 4.13.0, you can see that the quotes around the string argument to url() have changed from single quotes to double quotes. I am guessing this is due to chore(deps-dev): bump css-loader from 5.2.7 to 6.7.1.

The angular builder uses postcss-loader to parse the swagger-ui.css and apparently doesn't like the double quote syntax (or possibly the escaped double quotes inside the string) for url() arguments.

@nspire909
Copy link

I created an issue with postcss-loader: webpack-contrib/postcss-loader#595

Here is a repo to recrate:
https://github.com/nspire909/swagger-test

Run yarn to install deps. It should work fine with npm install too.

yarn build (or ng build) to build with swagger-ui.css v4.13.0 => fails
yarn build -c legacy or ( ng build -c legacy) to build with swagger-ui.css v4.12.0 => succeeds

If you try to yarn build again it will succeed. This is an issue with the angular cli cache. Please delete the angular cache with rm -rf .angular between each build to insure that it does a full build each time.

@thusharalk
Copy link
Author

I created an issue with postcss-loader: webpack-contrib/postcss-loader#595

Here is a repo to recrate: https://github.com/nspire909/swagger-test

Run yarn to install deps. It should work fine with npm install too.

yarn build (or ng build) to build with swagger-ui.css v4.13.0 => fails yarn build -c legacy or ( ng build -c legacy) to build with swagger-ui.css v4.12.0 => succeeds

If you try to yarn build again it will succeed. This is an issue with the angular cli cache. Please delete the angular cache with rm -rf .angular between each build to insure that it does a full build each time.

Thanks for update, with v4.12.0 it worked well. will wait till update from developers.

msavy added a commit to apiman/apiman that referenced this issue Mar 16, 2023
To avoid incompatibility with Angular 13's dependency set, revert
Swagger to 4.12.0.

See: angular/angular-cli#12797
swagger-api/swagger-ui#8116
@michael-prewitt-ridge
Copy link

I am also experiencing this issue with React and Webpack. I tried upgrading to 5.7.2 and the issue still persisted 😢

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

No branches or pull requests

3 participants