Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug report] Webpack can not handle assets file from packages #1443

Open
Mister-Hope opened this issue Dec 1, 2023 · 3 comments
Open

[Bug report] Webpack can not handle assets file from packages #1443

Mister-Hope opened this issue Dec 1, 2023 · 3 comments
Assignees
Labels
bug Something isn't working package:bundler-webpack

Comments

@Mister-Hope
Copy link
Member

Mister-Hope commented Dec 1, 2023

Description

Webpack fails when using assets file in packages.

E.g.:

packageA
  a.js
  a.jpg
  a.css
  a.ttf
// a.css
@font-face {
 // ...
 src: url("./a.ttf") // expecting the ttf can be handled
}
// a.js
import a from './a.jpg' // expecting image path

The above all working at Vite, but fails in Webpack.


Example logs:

{
  moduleIdentifier: '/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/esbuild-loader@4.0.2_webpack@5.89.0/node_modules/esbuild-loader/dist/index.cjs??clonedRuleSet-6.use[0]!/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/mini-css-extract-plugin@2.7.6_webpack@5.89.0/node_modules/mini-css-extract-plugin/dist/loader.js!/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/css-loader@6.8.1_webpack@5.89.0/node_modules/css-loader/dist/cjs.js??clonedRuleSet-9.use[1]!/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/postcss-loader@7.3.3_postcss@8.4.31_webpack@5.89.0/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-9.use[2]!/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/vuepress-plugin-md-enhance@2.0.0-rc.1_flowchart.ts@2.0.0_mathjax-full@3.2.2_mermaid@10.6.1_re_73rm6fxvjsbxj5n6juzbrykydq/node_modules/vuepress-plugin-md-enhance/lib/client/styles/revealjs/theme/fonts/league-gothic/league-gothic.css',
  moduleName: './node_modules/.pnpm/vuepress-plugin-md-enhance@2.0.0-rc.1_flowchart.ts@2.0.0_mathjax-full@3.2.2_mermaid@10.6.1_re_73rm6fxvjsbxj5n6juzbrykydq/node_modules/vuepress-plugin-md-enhance/lib/client/styles/revealjs/theme/fonts/league-gothic/league-gothic.css',
  message: 'Module build failed (from ./node_modules/.pnpm/mini-css-extract-plugin@2.7.6_webpack@5.89.0/node_modules/mini-css-extract-plugin/dist/loader.js):\n' +
    'HookWebpackError: Module build failed (from ./node_modules/.pnpm/esbuild-loader@4.0.2_webpack@5.89.0/node_modules/esbuild-loader/dist/index.cjs):\n' +
    'Error: Transform failed with 1 error:\n' +
    '/home/runner/work/Mister-Hope.github.io/Mister-Hope.github.io/node_modules/.pnpm/vuepress-plugin-md-enhance@2.0.0-rc.1_flowchart.ts@2.0.0_mathjax-full@3.2.2_mermaid@10.6.1_re_73rm6fxvjsbxj5n6juzbrykydq/node_modules/vuepress-plugin-md-enhance/lib/client/styles/revealjs/theme/fonts/league-gothic/league-gothic.eot:2:338: ERROR: Expected ";" but found "�"\n' +

https://github.com/vuepress-theme-hope/vuepress-theme-hope/blob/main/packages/md-enhance/src/client/styles/revealjs/theme/fonts/league-gothic/league-gothic.css

Reproduction

https://github.com/Mister-Hope/Mister-Hope.github.io/actions/runs/7017110732/job/19089734000

Used Package Manager

pnpm

System Info

.
@Mister-Hope Mister-Hope added the bug Something isn't working label Dec 1, 2023
@Mister-Hope
Copy link
Member Author

It would be great to have this tracked and fixed.

@Mister-Hope
Copy link
Member Author

Mister-Hope commented Sep 22, 2024

Can this issue being tracked? @meteorlxy

This also prevents me adding font files in ecosystem plugins.

@Mister-Hope
Copy link
Member Author

@CZHanoi It would be great if you can provide a minimal reproduction and paste the repo here.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working package:bundler-webpack
Projects
None yet
Development

No branches or pull requests

2 participants