I am trying to bit-shift a bigint like so:
let foo = BigInt(420) << 32;
but I am getting the JavaScript Error: Operator '<<' cannot be applied to types 'bigint' and 'number'.
How do I bit-shift bigints in JavaScript?
As James have suggested as a comment and per the MDN documentation of the left shift operator (<<), both sides of the operation must be the same, either both are numbers or both are BigInts. So you should add a n at the end of the number literal (eg. 16n and 32n) to declare them as BigInts or explicitily create them as such.
Don't know if this is really your problem since the exception thrown is different compared to when I tried on the console, but I hope it helps.
Also, do not mark this as answered if it helped since I'd feel like stealing credit from James hahaha. I'm just trying to expand a little on the answer.