jaredpalmer / tsdx-monorepo

A really good starting point for your next React x TypeScript monorepo
MIT License
175 stars 9 forks source link

on `yarn start:app`, semver throws `Invalid Version: undefined` #10

Open HerbCaudill opened 3 years ago

HerbCaudill commented 3 years ago

Thanks for making this - seems like it is exactly what I need!

I followed the instructions in the readme to run the unmodified repo, and got an error from semver when trying to run yarn start:app:

 /tsdx-monorepo/example/index.tsx: Invalid Version: undefined
 at new SemVer (/tsdx-monorepo/example/node_modules/semver/semver.js:314:11)

I get the same result in Windows and WSL.

full bash output ```bash /mnt/c/git/jaredpalmer/tsdx-monorepo ⚡ yarn start:app yarn run v1.22.4 $ yarn run build && yarn --cwd example && yarn --cwd example start $ lerna run build lerna notice cli v3.22.1 lerna info Executing command in 2 packages: "yarn run build" lerna info run Ran npm script 'build' in '@thefakeorg/utils' in 5.6s: $ tsdx build --tsconfig tsconfig.build.json ✓ Creating entry file 1.1 secs ✓ Building modules 2.9 secs lerna info run Ran npm script 'build' in '@thefakeorg/react' in 5.8s: $ tsdx build --tsconfig tsconfig.build.json ✓ Creating entry file 1.1 secs ✓ Building modules 3 secs lerna success run Ran npm script 'build' in 2 packages in 11.4s: lerna success - @thefakeorg/react lerna success - @thefakeorg/utils [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... $ parcel index.html Server running at http://localhost:1234 🚨 /mnt/c/git/jaredpalmer/tsdx-monorepo/example/index.tsx: Invalid Version: undefined at new SemVer (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/semver/semver.js:314:11) at compare (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/semver/semver.js:647:10) at lt (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/semver/semver.js:688:10) at /mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/@babel/preset-env/lib/index.js:276:22 at Object.default (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/@babel/helper-plugin-utils/lib/index.js:22:12) at getEnvPlugins (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/parcel/src/transforms/babel/env.js:62:34) at getEnvConfig (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/parcel/src/transforms/babel/env.js:12:25) at async getBabelConfig (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/parcel/src/transforms/babel/config.js:32:19) at async babelTransform (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/parcel/src/transforms/babel/transform.js:6:16) at async JSAsset.pretransform (/mnt/c/git/jaredpalmer/tsdx-monorepo/example/node_modules/parcel/src/assets/JSAsset.js:83:5)` ```
HerbCaudill commented 3 years ago

See https://stackoverflow.com/questions/66459081/parcel-semver-bug - this now works if I upgrade Parcel to 2.0.0-beta.1 in example/package.json.


Edit: Hot refresh isn't working for me with Parcel 2, so I've downgraded to 1.12.3 as the StackOverflow answer suggests.