tsdx icon indicating copy to clipboard operation
tsdx copied to clipboard

Example project doesnt update when changes are made to stuff in src

Open molebox opened this issue 3 years ago • 4 comments

Current Behavior

When i make any changes to anything in the src folder (having run tsdx watch) nothing is picked up in the example project which is running.

Expected behavior

That when i make a change to my component, its reflected in the example project, live

Your environment

npx envinfo --system OS --browsers --binaries --npmPackages tsdx,typescript --npmGlobalPackages tsdx,typescript

The above command doesnt work for me:

$ npx envinfo --system OS --browsers --binaries --npmPackages tsdx,typescript --npmGlobalPackages tsdx,typescript
'"C:\Users\richa\AppData\Local\Yarn\bin\\..\Data\global\node_modules\.bin\envinfo.cmd"' is not recognized as an internal or external command,
operable program or batch file.

molebox avatar May 18 '21 14:05 molebox

If you are on Parcel V2 by any chances, then there's Parcel cache which needs to be configured properly. By default it serves cached version of your lib/app created on first run

wojciechprzerwa avatar Sep 03 '21 05:09 wojciechprzerwa

If you are on Parcel V2 by any chances, then there's Parcel cache which needs to be configured properly. By default it serves cached version of your lib/app created on first run

Could you serve any examples how to disable parcel v2 cache when using tsdx?

AndrzejSala avatar Sep 19 '21 16:09 AndrzejSala

Check it out: https://parceljs.org/cli.html#disable-the-filesystem-cache

wojciechprzerwa avatar Sep 20 '21 06:09 wojciechprzerwa

I had the same problem. It looks like this is a limitation of Parcel 2, see their issue #4332. Until they address the issue, you have to find a workaround.

I have no experience with parcel, nor with node or bash scripts, so the solution I am currently using is probably of poor quality, nevertheless I am sharing it, just in case it helps someone:

  1. Add this "prestart": "rm -r .parcel-cache", script to the package.json of the example folder
  2. Restart parcel anytime you need the example to pick up changes made in src (^C and then npm start)

DaviDevMod avatar Feb 12 '22 11:02 DaviDevMod