I am facing an issue with the following simple code snippet:
const getMethod = 'get';
const postMethod = 'post';
export type RequestMethod = getMethod | postMethod;
When I try this code in TypeScript Playground, it shows an error stating that it cannot find the constants getMethod
and postMethod
, even though a compiled version is displayed on the right side.
I used to use this code successfully before, so what could be wrong now? How can I resolve this error?
For reference, here is a screenshot of the error message: