'let' can only be used in a function. It could be that you just need to move your statement into a function