plasmo icon indicating copy to clipboard operation
plasmo copied to clipboard

[BUG] WARN | Unable to find any entry files. The extension might be empty

Open TommyWongDev opened this issue 1 year ago • 5 comments

What happened?

I have encountered this bug for a couple of time already. the project works well originally even for a new created project without any new code aded on it, but everytime when the plasmo server idled for a while of time (like 45mins to 1hr), this warn ing appear when I reload the webpage. Plasmo become unclickable and nothing works even for the default popup.tsx. I have to delete the project and start a new project everytime. May i know is there any solution to solve this? Thanks. Screenshot 2024-06-03 at 14 03 39

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

Plasmo v0.86.3
🔴 The Browser Extension Framework
🔵 INFO   | Starting the extension development server...
🟠 WARN   | Unable to find any entry files. The extension might be empty
🔵 INFO   | Loaded environment variables from: []

(OPTIONAL) Contribution

  • [X] I would like to fix this BUG via a PR

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I checked the current issues for duplicate problems.

TommyWongDev avatar Jun 03 '24 06:06 TommyWongDev

Hi Tommy,

I had the same issue, and tried recreating the project from scratch several times to try to isolate it.

In the end, it's because I had a src directory in the root of my Plasmo directory. By simply renaming this to anything else (even just src-another), it worked.

andymitchell avatar Jul 11 '24 11:07 andymitchell

I'll confirm what @andymitchell said there and add, if you plan to use the src folder (which I highly recommend when using tailwindcss) you also need to move items like the newtab folder into the src folder.

Plasmo uses a lot of implicit mapping and once you make a src folder it becomes the defacto place to store code.

bearjaws avatar Sep 06 '24 18:09 bearjaws

An additional warning if a src folder is found but no entrypoint would have been helpful, this drove me crazy for a good half hour :)

JustinGrote avatar Nov 12 '24 02:11 JustinGrote

Hi Tommy,  嗨,汤米,

I had the same issue, and tried recreating the project from scratch several times to try to isolate it.我遇到了同样的问题,并多次尝试从头开始重新创建项目以尝试隔离它。

In the end, it's because I had a src directory in the root of my Plasmo directory. By simply renaming this to anything else (even just src-another), it worked.最后,这是因为我在 Plasmo 目录的根目录中有一个 src 目录。只需将 this 重命名为其他任何内容(甚至只是 src-another),它就可以工作了。

that shit creazy! it works~

a839408177 avatar Dec 25 '24 08:12 a839408177

I ran into the same issue — having a src/ directory in the root caused my extension not to load at all (no popup, content, or background).

It would be really helpful if Plasmo could provide a build-time warning or hint when a src/ directory exists but the entrypoints (popup.tsx, background.ts, etc.) are not found inside it.

🔧 Solution: If you have a src/ directory, make sure to move your entrypoints like popup, background, and content inside src/.

This subtle issue cost me about 30 minutes to figure out, and there were no errors in the dev server or browser console 😢

You can check coument

kiJu2 avatar Apr 16 '25 05:04 kiJu2