Everything works effectively until I add the const amountOut
to the file.
You are passing 2 parameters into a function that is expecting 3. The second parameter is one value because you have it as an array in brackets - [AddressFrom, AddressTo].
You will need to either modify how you are passing in the parameters to the getAmountsOut function or modify the getAmountsOut function to accept 2 parameters, with one being an array.