Questions tagged [typescript]
Hello everyone i have a code like this: import { z } from 'zod' const options = [ ["a", { label: "A" }], ["b", { label: "B" }], ] as const export function optionsToEnum(entries: ReadonlyArray): [T, ...T[]] { const [firstVa
Continue reading →In react js with typescript i am gatting this type error. I was try multiple solution but, i cant be able to resove it. Please help me to solve.I was try webpack.config.js solution,rtl.config.js solution and other lots of solution which
Continue reading →I've written a utility function which accepts an object of Record type, removes null values and returns a new object of Record type. The questions is why typescript compiler doesn't infer filters[key] type as string | string[] type after
Continue reading →I'm trying to publish my typescript/nodejs package/project to npm but getting ERR! code E429 Too many requests I just created a game on typescript/nodeJS and tried to publish it on npm by first "npm login" and after that i used "npm publ
Continue reading →I have a typescript monorepo managed by nx. There are about 122 projects in this repo and all written in typescript nodejs. With yarn4 pnp enabled https://yarnpkg.com/features/pnp. There are some 3rd party dependencies used by most of th
Continue reading →lately I was doing some research of playwright .. my use case is get Post api call response while page loading and print out for further process...,I came across an issue that fetch post always returns Test ended it fails right at the fe
Continue reading →ion-input type password is clearing password when you type once and then again come back to this field and type something. it will clear password field. But type changed to text ,the issue is gone expecting It should not clear previous p
Continue reading →I have a state as below: const [doctor, setDoctor] = useState(null) and then a useEffect function as follows: useEffect(() => { if(!doctor){ axios.get(`doctor/${id}`).then(({data}) => { setDoctor(data
Continue reading →I get this error on my blog page: Properly defines charset Error! A character encoding declaration is required. It can be done with a tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header. Learn more about
Continue reading →I am designing a type definition like this type ApiConfig = { selectedTags: Array } My purpose is to force the value selectedTags has to be an array that is a subset of TagTypes like this: const apiConfig: ApiConfig = { selectedTags
Continue reading →How do I ... "Wait" for a data that is being accessed using @ViewChild from a parent component in a child component that is only accessed when a event is sent by this child component to the parent component? So, for clarifying... I have
Continue reading →I am validating my create campaign form by building yup schema. This form has a field called sellers and the field will be array of object with type of {id: number; label: string}. Typescript infers type of sellers object with optional m
Continue reading →I'm trying to create a delete function wherein It will show a loading state using useMutate of tanstackquery, but the problem is when I delete the button, it doesn't show the loading state even though I change the network speed. const B
Continue reading →In my class MyClass, I'm writing an instance method callByName that calls another instance method when passed the other method's name. But I keep getting type errors when attempting to actually call the method: Typescript playground clas
Continue reading →I have a constant tree-like object to model nested relations and am trying to build a type that keys these relations by a fixed property of the parent object; i.e. I want to take this: const tree = { label: 'root', leaves: [
Continue reading →I've been working on a react app (localhost:3000) that uses an external API (localhost:8000). I tried to implement a session-based authentification system using express-session. When I log in, req.session.isAuthenticated is true. However
Continue reading →I have the following interfaces: export interface Base { a: string; b: string; } export interface Foo extends Base { c: string[]; type: 'foo'; } export interface Bar extends Base { c: string; type: 'bar'; } From these
Continue reading →I'm trying to use socket.io with the NuxtJS 3 nitro server. The problem is that my websocket only works in development mode. When I send it to production I cannot receive a response from the websocket. Maybe it's because I'm not using th
Continue reading →https://www.packola.com/pages/tool?sku=SHIPBOX-ST:RSC-L:12-W:12-D:12-MT:WHT-FLT:B-CL:40-TA:10-QTY:250&page_id=25&page_revision_id=10414 The above is the case I want to simulate. The length, width and height of the packaging box model can
Continue reading →Im trying to write a basic ts function to set an array of authorized emails, but checking it with these logs export const createSection = async (section: Section): Promise => { const newSectionRef = await setDoc( doc(sectionsCollec
Continue reading →