Arquisoft / viade_en2a

Viade en2a
GNU General Public License v3.0
0 stars 13 forks source link

Add package-lock.json to repository #221

Closed pglez82 closed 4 years ago

pglez82 commented 4 years ago

I have sent an email yesterday to Sara with the explanation to your problems (why it worked in localhost and it didn't in ghpages). I am attaching here the info so it gets to all the team members and you can fix it:

Basically you where using the library solid-react-components in its version ^0.5.0. As you do not have package-lock.json in the repository (it was added to gitignore in the mid of March), when you run npm install in a machine we can have two possible situations:

1) if the machine already has a package.json (which happened to all of us, included me that I already had the repository cloned), the installed version of this library is the one in defined in this file (package-lock.json), that means the initial version 0.5.0. In this version the constructor that gave you the error in ghpages had 2 parameters and your code was calling this constructor with two parameters. So, everything was working perfectly in localhost.

2) if the machine clones the project from scratch and thus, we do not have package-lock.json (that happens in travis, a docker container or in aws, etc) when you run npm install the library version will be the latest version available up until 0.9.9 (note that you used the ^). That means in ghpages, aws and docker the version that we had was 0.5.3. In this version the constructor was changed to three parameters and then the application was failing...

The lesson here. Always put your package-lock.json in the repository. For me it has been a lesson as well as I never had encountered such a critical example. Hope we all have learn a lot from this mistake. At least now the mystery was solved.

Let me know if you have any questions about this.

Pablo