jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.24k stars 508 forks source link

v0.14.0 rpts2 cache issue with Yarn workspaces #888

Closed jaredpalmer closed 3 years ago

jaredpalmer commented 3 years ago

Current Behavior

TSDX isn't building when used with yarn workspaces. Seems like it may be a rollup-plugin-typescript-2 cache issue?

(typescript) Error: ENOENT: no such file or directory, rename '/Users/jared/workspace/github/jaredpalmer/formik-actual/packages/formik/node_modules/.cache/rollup-plugin-typescript2/rpt2_48f7284bed271946d808c741a74a6d872af7a18e/code/cache_' -> '/Users/jared/workspace/github/jaredpalmer/formik-actual/packages/formik/node_modules/.cache/rollup-plugin-typescript2/rpt2_48f7284bed271946d808c741a74a6d872af7a18e/code/cache'
Error: ENOENT: no such file or directory, rename '/Users/jared/workspace/github/jaredpalmer/formik-actual/packages/formik/node_modules/.cache/rollup-plugin-typescript2/rpt2_48f7284bed271946d808c741a74a6d872af7a18e/code/cache_' -> '/Users/jared/workspace/github/jaredpalmer/formik-actual/packages/formik/node_modules/.cache/rollup-plugin-typescript2/rpt2_48f7284bed271946d808c741a74a6d872af7a18e/code/cache'
    at Object.renameSync (fs.js:643:3)
    at RollingCache.roll (/Users/jared/workspace/github/jaredpalmer/formik-actual/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:24003:12)
    at TsCache.done (/Users/jared/workspace/github/jaredpalmer/formik-actual/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:24845:24)
    at Object._ongenerate (/Users/jared/workspace/github/jaredpalmer/formik-actual/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:29098:21)
    at Object.generateBundle (/Users/jared/workspace/github/jaredpalmer/formik-actual/node_modules/tsdx/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:29076:18)
    at /Users/jared/workspace/github/jaredpalmer/formik-actual/node_modules/rollup/dist/shared/node-entry.js:13117:25
    at processTicksAndRejections (internal/process/task_queues.js:94:5)

Expected behavior

TSDX 14 works with yarn workspaces

Suggested solution(s)

Additional context

Your environment

  System:
    OS: macOS 10.15.5
    CPU: (8) x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
    Memory: 2.11 GB / 16.00 GB
    Shell: 3.0.2 - /usr/local/bin/fish
  Binaries:
    Node: 12.14.1 - ~/n/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.13.4 - ~/n/bin/npm
  Browsers:
    Chrome: 85.0.4183.121
    Chrome Canary: 87.0.4273.0
    Firefox: 71.0
    Firefox Developer Edition: 67.0
    Firefox Nightly: 58.0a1
    Safari: 13.1.1
    Safari Technology Preview: 14.0
  npmGlobalPackages:
    tsdx: 0.14.0
    typescript: 3.8.3
jaredpalmer commented 3 years ago

Have no idea why that happened. Nuked node modules and now it seems to be okay.

agilgur5 commented 3 years ago

Looks like this is a cache bug upstream that was recently fixed: https://github.com/ezolenko/rollup-plugin-typescript2/pull/243

agilgur5 commented 3 years ago

Gonna reverse mark this as duplicate of #892 since that now has more investigations

agilgur5 commented 3 years ago

This has been fixed with #896 / https://github.com/ezolenko/rollup-plugin-typescript2/pull/243 and just released in v0.14.1.