[BUG] WARN | Unable to find any entry files. The extension might be empty
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.
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.
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.
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.
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 :)
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
srcdirectory in the root of my Plasmo directory. By simply renaming this to anything else (even justsrc-another), it worked.最后,这是因为我在 Plasmo 目录的根目录中有一个src目录。只需将 this 重命名为其他任何内容(甚至只是src-another),它就可以工作了。
that shit creazy! it works~
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 😢