Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

v2: Move dist dir out of .parcel-cache #3691

Closed
magcius opened this issue Oct 27, 2019 · 7 comments
Closed

v2: Move dist dir out of .parcel-cache #3691

magcius opened this issue Oct 27, 2019 · 7 comments

Comments

@magcius
Copy link

magcius commented Oct 27, 2019

💬 RFC

I have to clear .parcel-cache quite often to get around stale cache issues, but this wipes .parcel-cache\dist. As noted in #3407, I have set up special data inside .parcel-cache\dist so that I can test from a dev server, but this makes wiping the parcel cache quite annoying.

Currently, it is hardcoded that the dist dir is inside the cache dir: https://github.com/parcel-bundler/parcel/blob/v2/packages/reporters/dev-server/src/ServerReporter.js#L25

But this makes it hard to wipe the assets from the build without affecting the dist folder.

Alternatively, the cache folder could set things up so that it is .parcel-cache/dist and .parcel-cache/assets, and then I can simply wipe one folder.

@devongovett
Copy link
Member

We'd like to get to the point where you never need to manually delete the cache. Any patterns of when you need to delete it?

@magcius
Copy link
Author

magcius commented Oct 27, 2019

I had to delete the cache pretty regularly after changing configuration. To give one example: when first trying to use Parcel 2, I got this error message:

$ D:\Development\NITRO_BMD\node_modules\.bin\parcel src\index.html
Server running at http://localhost:1234
× D:\Development\NITRO_BMD\src\main.ts: D:\Development\NITRO_BMD\src\main.ts: 'const' enums are not supported.

So I ^C parcel, and then added in a .parcelrc:

{
    "extends": "@parcel/config-default",
    "transforms": {
        "*.ts": [ "@parcel/transformer-typescript-tsc", "@parcel/transformer-js" ]
    }
}

Upon re-running Parcel, I encounter this error:

$ D:\Development\NITRO_BMD\node_modules\.bin\parcel src\index.html
Server running at http://localhost:1234
× Dependency did not resolve to an asset
    at MutableBundleGraph.createBundleGroup (D:\Development\NITRO_BMD\node_modules\@parcel\core\lib\public\MutableBundleGraph.js:69:13)
    at enter (D:\Development\NITRO_BMD\node_modules\@parcel\bundler-default\lib\DefaultBundler.js:58:41)
    at enter (D:\Development\NITRO_BMD\node_modules\@parcel\core\lib\Graph.js:475:16)
    at walk (D:\Development\NITRO_BMD\node_modules\@parcel\core\lib\Graph.js:310:26)
    at walk (D:\Development\NITRO_BMD\node_modules\@parcel\core\lib\Graph.js:331:22)
    at walk (D:\Development\NITRO_BMD\node_modules\@parcel\core\lib\Graph.js:331:22)

Wiping the .parcel-cache fixes it. I am happy to give more detailed repro instructions if necessary.

I have had to wipe the cache multiple times in the process of exploring fixes for #3690 as well.

@mischnic
Copy link
Member

Upon re-running Parcel, I encounter this error:

(Sounds similar to this (where the cache becomes corrupt when parcel crashed because of an error or Ctrl-c): #3655)

@magcius
Copy link
Author

magcius commented Oct 27, 2019

The repro I posted is 100% consistent, if you are having a hard time reproducing the other issue.

@alidcast
Copy link

@devongovett Testing out Parcel 2, so I'll add - I have to delete the cache any time I make a change to a linked package.

@DeMoorJasper
Copy link
Member

@Alidlo there's an issue to track this #4332 we're working on fixing this.

@devongovett
Copy link
Member

The dist dir was moved out of the cache in #4519.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants