Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ParcelJS bundling error - favicon.ico: Invalid Version: undefined

This is the first time I am using ParcelJS. I npm it following their instruction everything looks good. So it would be the latest version. As soon as I run it against my project (a .html file with some js and css attached to it), I get this error.

favicon.ico: Invalid Version: undefined

I have tried to ask Google without much luck. Got any ideas?enter image description here

like image 927
Tom Avatar asked Mar 03 '21 03:03

Tom


People also ask

How do I fix the parcel error in the latest version?

This is a known problem in the newest version of Parcel. The solution of this problem was to revert back to version 1.12.3, or by updating to the version 2 of Parcel. You can do the first solution by: You might have to refactor your code a bit to prevent breaking changes if you decided to use the nightly version of Parcel.

Why does the @Babel/preset-env package throw an invalid version undefined error?

The @babel/preset-env package starting at v7.13.9 and above will throw a "Invalid Version: undefined" error on build time, as a result of a conflict with parcel-bundler v1.

Is there a way to fix parcel V1 error 5943?

See discussion here: parcel-bundler/parcel#5943 There is no fix in Parcel v1, so @babel/preset-env should be pegged here until Parcel is upgraded to v2 or another solution is found. Sign up for free to join this conversation on GitHub .

What compiler does parcel use?

Parcel is built on the SWC compiler, which handles transpiling JavaScript, JSX, and TypeScript. On top of SWC, Parcel implements dependency collection, bundling, scope hoisting, tree shaking, Node emulation, hot reloading, and more.


1 Answers

If you are using Parcel version 1.12.4 this github issue is the reason why you got this error. It's not your fault.

You may try to pin your Parcel version as 1.12.3 in package.json:

"dependencies": {
  "parcel": "1.12.3"
},

If your Parcel is installed globally, you may check your version of Parcel:

parcel --version
1.12.4

Uninstall 1.12.4 and reinstall 1.12.3:

npm uninstall -g parcel-bundler
npm install -g [email protected]
like image 96
Bemn Avatar answered Oct 20 '22 08:10

Bemn