question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parcel error: example\index.tsx: Invalid Version: undefined

See original GitHub issue

I ran npx tsdx create mixpoint and chose the react option, then went into /example and ran npm install then npm start and ran into this:

PS C:\dev\mixpoint\example> npm start

> example@1.0.0 start C:\dev\mixpoint\example
> parcel index.html

Server running at http://localhost:1234 
×  C:\dev\mixpoint\example\index.tsx: Invalid Version: undefined
    at new SemVer (C:\dev\mixpoint\example\node_modules\@babel\preset-env\node_modules\semver\semver.js:314:11)
    at compare (C:\dev\mixpoint\example\node_modules\@babel\preset-env\node_modules\semver\semver.js:647:10)  
    at lt (C:\dev\mixpoint\example\node_modules\@babel\preset-env\node_modules\semver\semver.js:688:10)       
    at C:\dev\mixpoint\example\node_modules\@babel\preset-env\lib\index.js:276:22
    at Object.default (C:\dev\mixpoint\example\node_modules\@babel\helper-plugin-utils\lib\index.js:22:12)    
    at getEnvPlugins (C:\dev\mixpoint\example\node_modules\parcel\src\transforms\babel\env.js:62:34)
    at getEnvConfig (C:\dev\mixpoint\example\node_modules\parcel\src\transforms\babel\env.js:12:25)
    at async getBabelConfig (C:\dev\mixpoint\example\node_modules\parcel\src\transforms\babel\config.js:32:19)
    at async babelTransform (C:\dev\mixpoint\example\node_modules\parcel\src\transforms\babel\transform.js:6:16)
    at async JSAsset.pretransform (C:\dev\mixpoint\example\node_modules\parcel\src\assets\JSAsset.js:83:5) 

Your environment

PLEASE RUN THIS COMMAND INSIDE YOUR PROJECT:

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

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz 
    Memory: 6.39 GB / 15.92 GB
  Binaries:
    Node: 12.20.2 - C:\Program Files\nodejs\node.EXE      
    npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD        
  Browsers:
    Edge: Spartan (44.19041.423.0), Chromium (88.0.705.74)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    typescript: ^3.4.5 => 3.9.9

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14

github_iconTop GitHub Comments

27reactions
phamhieucommented, Mar 2, 2021

I got the same issue.

Manually update parcel package under example app to the latest version fix the bug "parcel": "^2.0.0-beta.1"

12reactions
phamhieucommented, Mar 14, 2021

You’re welcome to workaround by upgrading to the beta yourself

Sadly, this will break hot module reloading. I couldn’t find any solution so I gave up.

Right now, I use parcel v1.12.3 which doesn’t have the above issue.

// on example/package.json
// From
"parcel": "^1.12.3",

// To
"parcel": "1.12.3",
Read more comments on GitHub >

github_iconTop Results From Across the Web

Parcel SemVer bug - node.js - Stack Overflow
This is a known problem in the newest version of Parcel. ... where parcel@1.12.4 kept throwing Invalid Version: undefined even after trying ...
Read more >
InstantSearch.js app - Invalid Version: undefined - Open Q&A
After following the steps under Getting Started | Building Search UI | Guide | Algolia Documentation, I am encountering the following error: ...
Read more >
tsdx の使い方 - Zenn
Parcel error : example\index.tsx: Invalid Version: undefined のエラーで ... Zero-config CLI for TypeScript package development - fixes issue ...
Read more >
Build your First Typescript Package in Under 10 Minutes
This guide is a simplified version of what I learned publishing my first package. ... example/index.tsx import 'react-app-polyfill/ie11'; ...
Read more >
Build failed due to a user error. Build script returned non-zero ...
My first time trying to deploy a website using parcel to build, ... 11:49:37 PM: /opt/build/repo/images/logo.svg: Invalid Version: undefined 11:49:37 PM: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found