jaredpalmer / tsdx

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

Example fails to run after creating a fresh lib #1175

Open leobastiani opened 1 year ago

leobastiani commented 1 year ago

Current Behavior

npx tsdx create mylib (with react) cd mylib/example yarn yarn start

❯ yarn start
yarn run v1.22.19
$ parcel index.html
Server running at http://localhost:1234 
🚨  /Users/leonardo.bastiani/mylib/example/index.tsx: Invalid Version: undefined
    at new SemVer (/Users/leonardo.bastiani/mylib/example/node_modules/semver/semver.js:314:11)
    at compare (/Users/leonardo.bastiani/mylib/example/node_modules/semver/semver.js:647:10)
    at Function.lt (/Users/leonardo.bastiani/mylib/example/node_modules/semver/semver.js:688:10)
    at /Users/leonardo.bastiani/mylib/example/node_modules/@babel/preset-env/lib/index.js:225:11
    at Object.default (/Users/leonardo.bastiani/mylib/example/node_modules/@babel/helper-plugin-utils/lib/index.js:31:12)
    at getEnvPlugins (/Users/leonardo.bastiani/mylib/example/node_modules/parcel/src/transforms/babel/env.js:62:34)
    at getEnvConfig (/Users/leonardo.bastiani/mylib/example/node_modules/parcel/src/transforms/babel/env.js:12:25)
    at async getBabelConfig (/Users/leonardo.bastiani/mylib/example/node_modules/parcel/src/transforms/babel/config.js:32:19)
    at async babelTransform (/Users/leonardo.bastiani/mylib/example/node_modules/parcel/src/transforms/babel/transform.js:6:16)
    at async JSAsset.pretransform (/Users/leonardo.bastiani/mylib/example/node_modules/parcel/src/assets/JSAsset.js:83:5)
ehubbell commented 1 year ago

Looks like this is a known issue with semver.

Thread: https://github.com/parcel-bundler/parcel/issues/5943 Temp workaround that worked for me: https://github.com/parcel-bundler/parcel/issues/5943#issuecomment-788715242