PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.67k stars 370 forks source link

[BUG] An error occurred when the font file in the assets folder was imported after the 0.84.2 upgrade #883

Open waylonzheng opened 10 months ago

waylonzheng commented 10 months ago

What happened?

In version 0.84.0, it looks normal

image

However, in version 0.84.2, an error is thrown

image

In fact, the assets file is in the root directory and not in the src directory

Version

Latest

What OS are you seeing the problem on?

No response

What browsers are you seeing the problem on?

No response

Relevant log output

🟣 Plasmo v0.84.2
🔴 The Browser Extension Framework
🔵 INFO   | Prepare to bundle the extension...
🔵 INFO   | Loaded environment variables from: []
(node:47135) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
🔴 ERROR  | ENOENT: no such file or directory, stat '/Users/10083093/Desktop/MINE/ovo-tab/packages/extension/src/assets/font/ovo.woff2'
🔴 EXIT   | 👋 Good bye and have a great day!

(OPTIONAL) Contribution

Code of Conduct

louisgv commented 10 months ago

What's the import path that you used for this asset?

--Louis

On Wed, Jan 31, 2024, 09:51 Waylon Zheng @.***> wrote:

What happened?

In version 0.84.0, it looks normal image.png (view on web) https://github.com/PlasmoHQ/plasmo/assets/57901829/c3946800-2efb-4a71-a1e5-644167079033 However, in version 0.84.2, an error is thrown image.png (view on web) https://github.com/PlasmoHQ/plasmo/assets/57901829/b1df386a-c3b2-49be-b18c-776e776d1aff In fact, the assets file is in the root directory and not in the src directory Version

Latest What OS are you seeing the problem on?

No response What browsers are you seeing the problem on?

No response Relevant log output

🟣 Plasmo v0.84.2 🔴 The Browser Extension Framework 🔵 INFO | Prepare to bundle the extension... 🔵 INFO | Loaded environment variables from: [] (node:47135) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) 🔴 ERROR | ENOENT: no such file or directory, stat '/Users/10083093/Desktop/MINE/ovo-tab/packages/extension/src/assets/font/ovo.woff2' 🔴 EXIT | 👋 Good bye and have a great day!

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

— Reply to this email directly, view it on GitHub https://github.com/PlasmoHQ/plasmo/issues/883, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTJP5XZ2V5IZRNPZF7FZDDYRGWTLAVCNFSM6AAAAABCSJPYUWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYDSMJXHE2DAMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

waylonzheng commented 10 months ago

您用于该资产的导入路径是什么? …… ——路易斯 2024 年 1 月 31 日星期三 09:51 Waylon Cheng @.> 写道: 发生了什么事?在0.84.0版本中,它看起来很正常 image.png (在网络上查看) < https://github.sheincorp.cn/PlasmoHQ/plasmo/assets/57901829/c3946800-2efb-4a71-a1e5-644167079033 > 但是,在版本中0.84.2,抛出错误 image.png (网页查看) < https://github.sheincorp.cn/PlasmoHQ/plasmo/assets/57901829/b1df386a-c3b2-49be-b18c-776e776d1aff > 其实资产文件位于根目录中,而不是在 src 目录中 版本 最新 您在什么操作系统上看到该问题? 无响应 您在哪些浏览器上看到此问题? 无响应 相关日志输出 🟣 Plasmo v0.84.2 🔴 浏览器扩展框架 🔵 INFO |准备捆绑扩展... 🔵 信息 |从以下位置加载环境变量:[](节点:47135)[DEP0040] DeprecationWarning:“punycode”模块已弃用。请改用用户态替代方案。 (使用 node --trace-deprecation ... 显示警告的创建位置) 🔴 错误 | ENOENT:没有这样的文件或目录,stat '/Users/10083093/Desktop/MINE/ovo-tab/packages/extension/src/assets/font/ovo.woff2' 🔴 退出 | 👋再见,祝你有美好的一天! (可选)贡献 - 我想通过 PR 行为准则修复此 BUG - 我同意遵循该项目的行为准则 - 我检查了当前问题 < https://github.sheincorp.cn/PlasmoHQ/plasmo/issues ?q=is%3Aopen+is%3Aissue+label%3Abug > 对于重复问题。 — 直接回复此电子邮件,在 GitHub 上查看 < #883 >,或取消订阅 < https://github.sheincorp.cn/notifications/unsubscribe-auth/ABTJP5XZ2V5IZRNPZF7FZDDYRGWTLAVCNFSM6AAAAABCSJPYUWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYDSMJXHE2DAMA > 。您收到此消息是因为您订阅了该主题。消息 ID:@.>

I used url(data-base64:~assets/font/ovo.woff2) format('woff2'); to import the font file in the src directory,In fact, the font file is located under the assets folder at the root of the project,But after I upgraded to version 0.84.2, it went looking for asset files in the src directory.In version 0.84.0, it is normal

kiwiflydream commented 10 months ago

I'm having the same problem. The icon.png suddenly has to be fetched from the src/assets directory

leshalv commented 10 months ago

I'm having the same problem.

zorridge commented 9 months ago

I am having the same problem! If I try to use absolute import like such

.css image

or

.scss image

I get EISDIR: illegal operation on a directory, read

northsea4 commented 8 months ago

Same problem! 0.84.0 is fine, and later versions (up to 0.85.2) have this problem.

drmanhatin commented 8 months ago

same.

rebryk commented 5 months ago

same