0

It's coming across to me one awkward issue. I made this project a while ago with React using Parcel to build. Now after a couple of months I tried to start the project and it gave me some errors building. I download again the project from the repository and the parcel started to build again for a couple of hours and the same error came up again. Once again, I download the project from the repository and it start to run again, but without any change made in the project...it started to give again the same Build Error. Did some of you had this issue?

Parcel Build failing

Package.json

Thank you!

Andrew Stegmaier
  • 3,429
  • 2
  • 14
  • 26
  • I see your project is pinned to parcel version `2.0.0-rc0`, which is quite old and a pre-release version - do you see the same errors when you upgrade `parcel`, `@parcel/transformer-image`, and `@parcel/transformer-sass` to the latest `2.5.0` release? – Andrew Stegmaier Apr 26 '22 at 18:33
  • @AndrewStegmaier thank you for your answer! Just updated and now I got this new error. [New Error](https://postimg.cc/cr8N6wK6) – João Mendonça Apr 27 '22 at 09:48

1 Answers1

0

(This answer is in response to the New Error you get after upgrading the project to parcel 2.5.0)

When you run parcel index.html, you'll be invoking the version of parcel that's installed globally, not the one locally specified by package.json. The error your getting is what I'd expect if the global version was still 2.0.0-rc0 (released August 2021) was run and tried to use the latest version of @parcel/config-default (installed in your project), because compressor plugin support was added in September 2021.

From the original screenshots, it looks like you already have a "start" command in your package.json...

{
   "scripts": {
       "start": "parcel index.html"
   }
}

Invoke it by running npm run start - this will use the version of parcel (2.5.0) installed there.

Andrew Stegmaier
  • 3,429
  • 2
  • 14
  • 26
  • Hi @AndrewSetgmaier, thank you so much for all your patience and explanation! Indeed, it makes all the sense, but something continuous wrong and I'm finding quite hard for a solution to fix it: ['Error: Got unexpected null'](https://postimg.cc/QByLcLbv) – João Mendonça Apr 29 '22 at 10:05
  • That's not an error I've seen before. Could you post a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example), perhaps as a github repo? – Andrew Stegmaier Apr 29 '22 at 15:12
  • Sure! Here goes the guithub repo! Thank you! https://github.com/JonsMendi/myMovies-client/tree/dev – João Mendonça May 02 '22 at 11:38
  • I fixed parcel builds in [this PR](https://github.com/JonsMendi/myMovies-client/pull/3) see the description for details. I didn't see the same errors you did at first, but I tested these changes, and it worked. – Andrew Stegmaier May 02 '22 at 16:53
  • Thank you so much for your patience and incredible efficiency! for some reason, even after updating the parcel, it didn't change the version in the package.json...and as you explained it may have been that and the gap in "main: index.js" that I was unaware of in the parcel documentation itself . So far everything seems to be working perfectly! Thank you so much for your help and your time! – João Mendonça May 03 '22 at 16:24
  • Glad it worked! If you're happy with the answer, would you mind hitting the "accept" button so others will know? – Andrew Stegmaier May 03 '22 at 16:37
  • Definitely!! Thank you so much again! – João Mendonça May 04 '22 at 17:24