Fekide / strapi-plugin-translate

Strapi plugin for automated translations using different Translate Providers
https://market.strapi.io/plugins/strapi-plugin-translate
MIT License
49 stars 19 forks source link

[BUG]: Brackets in webpack chunk name #406

Closed renatosilvarosa closed 1 month ago

renatosilvarosa commented 3 months ago

Describe the bug The webpack chunk name contains brackets, so the generated file is named [translate-app]-....js.

According to the specs, brackets should be encoded, and even if browsers generally don't complain about them, there are some frameworks that flag the bracket character as illegal or harmful. This is the case for example of Spring Cloud Gateway.

In my case, I have Strapi Admin deployed into a subdomain, and Spring Cloud Gateway is used for routing. Requests to https://<my-domain>/<my-sub-domain>/admin/[translate-app]-....js are blocked by Spring because the [] are considered illegal characters in a URL.

To Reproduce Steps to reproduce the behavior:

  1. Build a Strapi admin app using strapi-plugin-translate
  2. Observe that the generated js file name contains []

or

  1. Click on "Translate" button on Strapi Admin
  2. Observe network requests
  3. Notice that a file named [translate-app]-....js has been requested by the browser.

Expected behavior A webpack chunk name containing no special characters.