In my local environment, it works fine when I wrap it in quotes, but it seems like that doesn’t work in Vercel. Is there a fix for this? I already tried escaping it with \.
@babylon1999
Try using double quotes, too, just to see if it works ("VALUE" instead of 'VALUE'). If that does not work, you could encode it as a Base64, which will eliminate the # character, and decode the Base64 to a normal string in your code.
const encodedToken = process.env.TOKEN;
const decodedToken = Buffer.from(encodedToken, "base64").toString("utf-8");
// Do something with the decodedToken!
If that does not work, you could encode it as a URI, which should also eliminate the # character, and decode the URI to a normal string in your code.
URI Encoding Example (does not work for this specific case)
It seems weird that not a lot of people are opening issues about this, tokens usually have all sorts of weird characters, there should be some sort of manual escaping in the Vercel dashboard.