-
Notifications
You must be signed in to change notification settings - Fork 511
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
Parcel error: example\index.tsx: Invalid Version: undefined #980
Comments
I got the same issue. Manually update parcel package under example app to the latest version fix the bug |
So this is caused by Parcel, not TSDX. It's caused by the very recent and the only pinned issue from Parcel: parcel-bundler/parcel#5943 . It seems like the Babel folks have deemed this a Parcel bug of using the API the wrong way (even though it only broke now after a few years), and the Parcel folks are currently not maintaining Parcel v1 despite v2 not being ready yet... There's not really much TSDX can do here because Parcel v2 isn't fully ready (upgrading the example deps to a beta generally means asking for more bug reports) and Babel and Parcel aren't fixing this as of now 😕 You're welcome to workaround by upgrading to the beta yourself at your own risk as @phamhieu suggests and working through any bugs there with the Parcel team. Although, based on the Parcel and Babel threads, v2 also has this bug in it, but doesn't always hit it. There is also a workaround by pinning "resolutions": {
"@babel/preset-env": "7.13.8"
} Also, with regard to the issue template:
The comment below this line should stay commented out and, importantly, you're missing the version of TSDX in your output; you probably ran this outside of your project directory -- the directions say to run inside of it. |
So there's been a fix pending upstream in parcel-bundler/parcel#5946 for almost as long as the issue has existed, but unfortunately it has not gotten much attention despite the wide impact of this across the JS community |
Sadly, this will break hot module reloading. I couldn't find any solution so I gave up. Right now, I use parcel
|
This comment has been minimized.
This comment has been minimized.
ah thanks for correcting me @phamhieu ! I posted a link to that line too on the same commit (tagged specifically to Those Babel versions are pretty old, but for the |
It seems |
I experienced this issue today. I added EDIT: Today I was working in a fresh TSDX React Storybook project, and it took some trial and error to get this error fixed. If I npm installed with parcel-bundler already in package.json, the error always persisted. I was able to get it to work by installing packages, running |
I tried |
It's ok. Or try |
@nfl404 this works. |
I don't think there is a permanent fix to this as of now until babel resolves the error. |
…r: 'Invalid Version: undefined' see jaredpalmer/tsdx#980
encountered the same issue, i just updated the parcel manually to the latest version and it worked. |
I ran
npx tsdx create mixpoint
and chose thereact
option, then went into /example and rannpm install
thennpm start
and ran into this:Your environment
PLEASE RUN THIS COMMAND INSIDE YOUR PROJECT:
npx envinfo --system OS --browsers --binaries --npmPackages tsdx,typescript --npmGlobalPackages tsdx,typescript
The text was updated successfully, but these errors were encountered: