Title: Binary file corruption: unplugin treats binary files as text · Issue #524 · unjs/unplugin · GitHub
Open Graph Title: Binary file corruption: unplugin treats binary files as text · Issue #524 · unjs/unplugin
X Title: Binary file corruption: unplugin treats binary files as text · Issue #524 · unjs/unplugin
Description: Environment platform: all unplugin version: 1.16.1 nodejs: 20.19.2 package manager: npm@10.8.2 Reproduction Repo: https://github.com/Loccko/unplugin-webpack-issues/tree/main To reproduce: Clone npm ci npm run build:webpack Try to open im...
Open Graph Description: Environment platform: all unplugin version: 1.16.1 nodejs: 20.19.2 package manager: npm@10.8.2 Reproduction Repo: https://github.com/Loccko/unplugin-webpack-issues/tree/main To reproduce: Clone npm...
X Description: Environment platform: all unplugin version: 1.16.1 nodejs: 20.19.2 package manager: npm@10.8.2 Reproduction Repo: https://github.com/Loccko/unplugin-webpack-issues/tree/main To reproduce: Clone npm...
Mail addresses
unplugin@1.x.x
unplugin@2.x.x
Opengraph URL: https://github.com/unjs/unplugin/issues/524
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Binary file corruption: unplugin treats binary files as text","articleBody":"### Environment\n\n- **platform**: all\n- **unplugin version**: 1.16.1\n- **nodejs**: 20.19.2\n- **package manager**: npm@10.8.2\n\n### Reproduction\n\nRepo: https://github.com/Loccko/unplugin-webpack-issues/tree/main\nTo reproduce:\n\n1. Clone\n2. `npm ci`\n3. `npm run build:webpack`\n4. Try to open images/font from `dist` folder\n\n### Describe the bug\n\nWhen using `@intlify/unplugin-vue-i18n`, unplugin corrupts all binary files (e.g., .jpg, .png, .svg) in the project, which then cannot be used in Vue components.\n\nThe root cause is `unplugin/dist/webpack/loaders/load.js`, which during execution calls the loader from `@intlify/unplugin-vue-i18n`. This loader does nothing with the source of these files (since the loader's condition check doesn't match). Subsequently, unplugin/dist/webpack/loaders/load checks the result of the unplugin-vue-i18n loader execution, which is undefined, and unplugin/dist/webpack/loaders/load calls the callback with the original input source.\n\n\n\nOriginal code: https://github.com/unjs/unplugin/blob/v1.16.1/src/webpack/loaders/load.ts\n\nSince `unplugin/dist/webpack/loaders/load.js` lacks the `raw = true` variable, webpack treats the source as regular text content and attempts to process it as text rather than binary data. \nInfo: https://webpack.js.org/api/loaders/#raw-loader\n\nThis results in corruption of all binary files, leading to broken image and font files that cannot be used.\n\n**Note:** This issue appears to be relevant for both unplugin@1.x.x and unplugin@2.x.x, as both major versions lack this variable.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```sh\n\n```","author":{"url":"https://github.com/Loccko","@type":"Person","name":"Loccko"},"datePublished":"2025-07-08T11:34:02Z","url":"https://github.com/unjs/unplugin/issues/524"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ae9ae4f5-c468-44b8-aaf9-3453d245a44a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AED6:2F59F2:1ED563:2B4553:6B006863 |
| html-safe-nonce | 5e64d5710595ffff31830c01f80463d2b5b31dab15b870e28d1bdd049521dd33 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUQ2OjJGNTlGMjoxRUQ1NjM6MkI0NTUzOjZCMDA2ODYzIiwidmlzaXRvcl9pZCI6Ijg2NTg1MDQ4NTkwNzIzNTg0OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bf926a5beed8962ab03339b4af5636d5770c26561b022b7354709c47819a975c |
| hovercard-subject-tag | issue:3212174866 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/unjs/unplugin/524/issue_layout |
| twitter:image | https://opengraph.githubassets.com/410e9fe71283a71c71e3eaf3d4c4a203b63262b1b6833150632c7599d5e072de/unjs/unplugin/issues/524 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/410e9fe71283a71c71e3eaf3d4c4a203b63262b1b6833150632c7599d5e072de/unjs/unplugin/issues/524 |
| og:image:alt | Environment platform: all unplugin version: 1.16.1 nodejs: 20.19.2 package manager: npm@10.8.2 Reproduction Repo: https://github.com/Loccko/unplugin-webpack-issues/tree/main To reproduce: Clone npm... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Loccko |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa |
| turbo-cache-control | no-preview |
| go-import | github.com/unjs/unplugin git https://github.com/unjs/unplugin.git |
| octolytics-dimension-user_id | 80154025 |
| octolytics-dimension-user_login | unjs |
| octolytics-dimension-repository_id | 385261169 |
| octolytics-dimension-repository_nwo | unjs/unplugin |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 385261169 |
| octolytics-dimension-repository_network_root_nwo | unjs/unplugin |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width