Open ailikecreative opened 1 year ago
@ailikecreative I think this should be addressed by upstream Parcel rather than Plasmo - since the stacktrace points to parcel-core. I'm not entirely sure how your project couldn't run - are you mix-matching your node/pnpm installation somehow between WSL and PWSH?... (this error and #734 potentially) might share the same cause within your system, unless you can share a clean reprod
in the contents folder, if I only put 1 file there the code runs normally, but if I put lots of sample files in my case there are 15 for each different website, when "pnpm dev" an error like that appears.
so according to the assumption that the cause is because there are too many files in the content folder, I don't know if this is true or not
I have been running into this issue (with pnpm & windows) since I tried adding a background message handler. Right now, the only way I can get a dev build is on a Mac instead. Not sure if it's related to the libraries I have imported, but I'll try and see if I can get a repro on a new project on that windows machine.
Update: this isn't related to the background script directly - just additional files. It appears that there isn't much tree-shaking, if at all, being done on some imports like lucide-react
, zod
, etc. I also had react-router
on a tabs entry point with multiple pages being imported lazily. That spun out separate files in the root directory with duplicated/shared bundles. My parcel cache data.mdb
file was at 4gb.
After porting the extension over to work with parcel natively, build times have improved considerably and the cache data.mdb
file is now sitting at under 50mb. It also seems to reuse the shared bundles more efficiently, but tree-shaking is similar since the underlying imports use conditional requires.
I came across the recommendation/work-around of increasing the minBundles like plasmo has configured due to an open issue with parcel (https://github.com/parcel-bundler/parcel/issues/8071), and updating the following configuration resulted in similar bundle file sizes like plasmo, but still the smaller cache file size.
"@parcel/bundler-default": {
"minBundles": 10000000,
"minBundleSize": 3000,
"maxParallelRequests": 20
}
In conclusion, I'll have to keep a closer eye on the imported packages as this could easily get out of hand.
What happened?
pnpm dev command always has problems,I've tried repeatedly still fails I tried to install the manual '@parcel/diagnostic' but it still got an error
Version
Latest
What OS are you seeing the problem on?
Windows
What browsers are you seeing the problem on?
Chrome, Microsoft Edge
Relevant log output
(OPTIONAL) Contribution
Code of Conduct