749 questions
0
votes
1
answer
24
views
Replicate Typescript VSCode Debug in: launch.json
I am looking for a solution to a (apparently rare) setup of a .vscode/launch.json config file, specifically for debugging Typescript directly.
This is extremely easy and simple to do manually in ...
1
vote
0
answers
63
views
Is there a way to specify TSX attribute types on derived classes, which may have conflicting attribute sets, without using constructors?
I'm working on adding JSX/TSX support to a little UI library I'm making. I want to be able to define the view hierarchy using a system similar to this:
<CCView frame="1 1 30 15" ...
1
vote
1
answer
80
views
pass data to tsx code stored in a variable
I have tsx stored as a template in a variable like so
// file a
let v = <div>text</div>
This should be used with some context or parameters in other files.
// file b
import v from a.tsx
...
0
votes
1
answer
80
views
MUI - Round border radius FormControl
I have a FormControl which currently looks something like this:
Now the problem is in the image below, the label Username is getting set at the edge due to the borderRadius which is making the label ...
0
votes
1
answer
118
views
type string is not assignable to type button submit reset undefined ts 2322 [duplicate]
I want to create component (custom modal form) in reactjs
index file
<CustomModalForm
button={UserModalFormConfig.button}
/>
config file
export const UserModalFormConfig = {
button: [
...
0
votes
1
answer
48
views
NPM Error during the scaffolding process for Motion Canvas
It should be a simple question, but it's a problem to me for I'm still a newbie in programming in general.
When I changed the repository (cd <path>), installed the dependencies (npm install), ...
0
votes
0
answers
50
views
TS2307: Cannot find module for imported SVG in React component library when used in another MFE
I'm working on a React component library where I'm importing SVG files as React components like this:
import React, { FC } from "react";
import { ReactComponent as DashedDangerSvgIconBase } ...
0
votes
1
answer
39
views
Flexbox justify-content:space-between doesn't work properly with position:absolute
I'm facing this issue:
I'm looking to use position:absolute, to adjust the span.materias__item-detalle, to bottom of the div, without caring the size that the h4 occupes.
But, I also want to use ...
0
votes
0
answers
39
views
React Native: Component "auth" has not been registered & routing not working (Expo Router)
Im working in a react native expo app, and everything was working fine..until i added firebase to it. i created the firebase.js config file and then and made changes in my auth.tsx (for authentication,...
0
votes
0
answers
38
views
LayoutTransition react issue
I am writing a web application in react-with-typescript:
I use index.tsx as a layout component, I need to somehow delay the transition between pages so that the animation of filling the screen can ...
0
votes
0
answers
37
views
Can I define a fake module to satisfy a import from a import?
i know this is a sort of a hack, but i'm trying to import a module on a DB seed script which is shared with the application, and for the application it is required to have a taint import import '...
2
votes
0
answers
549
views
Clerk's Expo Setup Not Working or a Rookie React Native Mistake?
I'm trying to follow Simon Grimm's tutorial on how to integrate Clerk Auth into a React Native app, but so far nothing happens. I've also tried to adapt it to what's on the updated Clerk docs, such as ...
0
votes
1
answer
159
views
Cannot get any response from langchain ChatOpenAI, no matter how long I wait
My code is as follows:
import { config } from "dotenv";
import { ChatOpenAI } from "@langchain/openai";
config({ override: true })
const openai = new ChatOpenAI({ model: "...
0
votes
1
answer
714
views
Why won't HeroUI's component load with css using NextJS
(English is not my first language btw)
I'm doing this school project and I'm using heroui as my component library, i thought I updated it to tailwind 4 and did the changes I thought I was supposed to ...
0
votes
2
answers
150
views
TypeScript optional prop with default value still possibly undefined [closed]
How can I defined optional property in React component with default value and make typescript understand that even though it's marked as optional in the props interface it has default value so it's ...
0
votes
0
answers
53
views
expo router not working properly on android
I'm trying to navigate to next screen on my app with expo router but it does not work as I expect. I need to click on the button twice before it actually takes me to the next screen which is not what ...
0
votes
0
answers
40
views
I am trying to set up a typescript repo to use tsx for development but when ever I run tsx I get type errors
When I run the command tsx watch src/bootstrap/server.ts I get this error:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. ...
0
votes
0
answers
54
views
(NOBRIDGE) WARN [Layout children]: No route named "inspection/[projectId]/[itemId]" exists in nested children
(NOBRIDGE) WARN [Layout children]: No route named "inspection/[projectId]/[itemId]" exists in nested children: ["+not-found", "login", "new-project", "...
0
votes
0
answers
45
views
Loader does not disappear when home is loaded
I'm trying to build a website in NextJS. In order to improve the UX, I created a Loader component.
The problem
The problem is that, when I start the Next server, even though the page is correctly ...
0
votes
1
answer
87
views
Getting type errors form a snippet copied from Next.js 15 docs (opengraph-image.tsx)
In the Next.js 15.1.6 docs (App Router), the last code snippet on the Metadata Files: opengraph-image and twitter-image | Next.js page explains how to fetch a local image on the file system and pass ...
0
votes
1
answer
85
views
Why does deleting an item from state still require a page reload to reflect in UI?
I'm building a workout tracking app with React using typescript, and I’m having trouble with a delete button. I have all the saved workouts in a list and when I try to remove a workout from the list ...
0
votes
1
answer
167
views
Running basic express server with tsx causes out of memory error
I have an extremely basic express.js server that when I run tsx server.ts it causes the node process to quickly get to over 8gb of memory and start to hit swap.
Code
import express from 'express';
...
0
votes
1
answer
120
views
Does Inversify actually require emitDecoratorMetadata for Typescript?
Inversify README claims that it requires "emitDecoratorMetadata": true in your tsconfig.json to be used with Typescript. But I am able to set it to false and my app runs just fine with ...
3
votes
1
answer
127
views
Subsequent Agenda Item Not Updating - react-native-calendars
I'm working on a react-native app, using the react-native-calendars Agenda feature.
I initialize the agenda with two items, containing a title and a description. Initially, the description is hidden.
...
1
vote
0
answers
535
views
how to check and uncheck all Shadcn checkbox
I am building a React project using ShadCN components and want to implement a "Select All" checkbox functionality.
However, I want to achieve this without using hooks (e.g., useState or ...
1
vote
1
answer
167
views
How to define a custom JSX namespace with verbatimModuleSyntax?
I am building my own TSX-based renderer for a specific runtime which is not web. I have two files in my library code:
// h.ts
import { type JSXInternal } from './jsx.js';
export function h(props: ...
0
votes
1
answer
57
views
The global component not found In the TSX file ! Vue3 + vite + TS
1. Project initialization with Vite.js
pnpm create vite
√ Project name: ... demo
√ Select a framework: » Vue
√ Select a variant: » Customize with create-vue ↗
$ Vue.js - The Progressive JavaScript ...
0
votes
0
answers
77
views
"SyntaxError: Cannot use import statement outside a module" when running compiled javascript code with Node.js
I am using TypeScript to build a Node.js application. After compiling the code, when I run the output JavaScript file using npm start, it throws the following error:
When I run the following command:
...
0
votes
0
answers
38
views
After the latest update of VSCode, my TSX code started throwing errors
The Vue code runs and builds without any issues, but it does show an error. Colleagues who haven't updated VSCode don't encounter this error, but those who have updated do.
Importing Fragment from ...
0
votes
0
answers
69
views
Switched from ts-node to tsx for dev. I am getting module import errors for some packages using tsx, but not tsc. Can you help identify a root cause?
I am using ESM imports and tsx is unsuccessful at importing some modules.
tsc compiles successfully in NODE_ENV production and I can run the output on node 20.10.0.
tsx and NODE_ENV development (which ...
0
votes
0
answers
90
views
Deprecation Warning and Missing Cache File Issue in tsx Generate Script
I'm running a script using tsx with the command npm run generate, and encountering the following output:
Using 'openai' model provider Generating storage context...
(node:23984) [DEP0040] ...
0
votes
1
answer
298
views
Write pure CSR components on Deno+Fresh
Sry that I'm new to front-end development.
I have a JS function that operates Monaco editor's API. Let's suppose it looks likes this:
export function setTheme(themeName) {
fetch(`./themes/${...
0
votes
1
answer
95
views
highcharts stock-tools not working(next.js)
I was using highcharts in my next.js project and everything was fine. but suddenly I noticed the stock tools are not working. they are showing and I can select them but they are not working and they ...
1
vote
0
answers
394
views
in vite ts environment when i using lucid react showing this error Module '"lucide-react"' has no exported member 'Workflow'.ts(2305)
for every icon import from the lucid react showing same error and its in typescripts environment.
Module '"lucide-react"' has no exported member 'LayoutDashboard'.ts(2305)
import ...
-1
votes
1
answer
320
views
getting React is not defined when building react ts code through esbuild for electron frontend
I am building an electron app for a project, where i am loading index.html in browserWindow, in that html i am downloading the script which is bundled via esbuild. The script is downloaded ...
1
vote
1
answer
170
views
How can I get dynamic routing properties in a template.tsx file in NextJS?
I have a file architecture as follows:
projects
|
-page.tsx
-[id]
|
-template.tsx
-overview
|
-page.tsx
-settings
|
-page.tsx
I am using server-rendered pages.
I want ...
-1
votes
1
answer
104
views
How to preserve newlines inside of JSX tags in TSX TypeScript?
I would like to use TSX for Markdown rendering, the problem - TypeScript TSX Compiler strips newlines and it breaks the markdown.
The example below would output text as Some text. - list item a - list ...
0
votes
1
answer
39
views
ref lost its reactivity in tsx
import { ref } from 'vue'
const Test = () => {
const msg = ref('I am Brave')
const changeMsg = () => {
console.log('aa')
msg.value = 'I will get everything I want'
}
return (
...
0
votes
1
answer
42
views
TSX file type mismatch and key prop does not exist error
I am trying to create a simple next.js application and trying to generate a table as follows:
interface User {
id: number;
name: string;
email: string;
}
const UserTable = async () => {
...
-1
votes
1
answer
25
views
Expo go show nothing but web show eveything [React Native]
I have a project named "Wikuhotel" use Expo React Native, if i open it on web the "Cart.tsx" screen show perfectly but when i open it on phone it show nothing
I tried to log the ...
0
votes
3
answers
277
views
Is there a way to get the JSX/TSX of a React component from the code itself?
I am writing a page to illustrate how to use a component I've developed and I'd like to build pairs of examples (rendered) with TSX source code that produces the example, ideally not having to repeat ...
0
votes
0
answers
75
views
Can't Get FlatList Scrolling to Work in React Native with Expo
I'm losing my mind trying to get scrolling to work in React Native using Expo. I've gone through the entire documentation for both ScrollView and FlatList and spent a whole day debugging, but ...
0
votes
1
answer
184
views
Type error: Type 'OmitWithTag<EventsPageProps, keyof PageProps, "default">' does not satisfy the constraint '{ [x: string]: never; }'
Here is my code:
import EventsContainer from "@/components/events/events-container/EventsContainer"; // Main container component
interface EventProps {
events: any[];
pastEvents: any[];
...
0
votes
1
answer
68
views
Using useEffect takes time to load and not using it leads to render the component twice
I have been working on password generator and I want a feature that generates the initial password when the user opens the site.
This takes time to load lets say 1-2 seconds.
const [password, ...
0
votes
3
answers
110
views
How to push to state and reflect in effect
I am trying to make a simple task list (a to-do list with a different name).
When I click a TaskAdder it calls the function add_task which is a string for now. This should update the effect in the ...
1
vote
0
answers
30
views
TSX: a variable set to either a Map<string,string> get() result or '' is shown as "string | undefined"
TSX question. I define an ES6 Map which is Map<string,string>, where all of the following constants are strings. There are no issues here.
export const CALLER_TYPE_TITLE_MAP = new Map<string,...
0
votes
1
answer
230
views
React Hook Form at Least One TextField Has Value
I have 2 controlled inputs on a form, and I only need to validate that 1 of them is filled in. I'm having trouble with the validation logic.
function atLeastOneChecked(inputs: ...
1
vote
0
answers
74
views
Using Vuetify with JSX
Could you please help? In my project, I'm using Vue 3 + TypeScript + TSX + Vuetify.
When I try to use Vuetify components, such as v-btn, I encounter a TypeScript error when listening to the onClick ...
-1
votes
1
answer
54
views
html tags do not apply in react tsx props
I have a code as following and when I want to bold a word I have no idea why html does not apply to it in my tsx file
<myComponent
contents={`<strong>example</strong> `}
>
...
0
votes
2
answers
55
views
How to access nested json object in tsx file?
I am trying to access nested JSON objects such as the code below, which works currently.
<img id="inactive-drive2" src='/src/assets/image/InActiveDrive.png' className={info.data.drives[1]?...