Knox
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Knox on 6/24/2024 in #questions
Migrate react-scripts to vite
I have a project using react-scripts 4 with a proxy-dev-server needed to start the app where I have:
And I'm migrating the project to use vite. I have almost everything done, can start the app but can't start the session
My new vite.config.ts looks like this https://gist.github.com/FACorreiaa/3c87607cb52ee6a52d332b5b2a0875f9
And from the examples I saw I need to start my proxy and vite concurrently:
My server endpoint responds with json
https://127.0.0.1:8443/api/v2/system/status
status: "operational"
But when I try to start my session I get:
If I go back on the react-scripts configs everything works fine tho. Anyone has any clue on what I might be missing on the vite part ?
2 replies
TTCTheo's Typesafe Cult
•Created by Knox on 5/8/2024 in #questions
Migrating react-query v3 to tanstack-query v4
Im almost finishing this migration process
Right now the problem im having is on the getChanges function:
Deleting the undefined value solves this error highlighting but the fetch of the data fails.
Am I missing something ?
5 replies
TTCTheo's Typesafe Cult
•Created by Knox on 4/10/2024 in #questions
React Table v7 Sorting
I have a question regarding react-table v7, its not possible to have server side sorting with the table doing the handle the sorting, right ?
From what I see on the examples, if I have client side sort I can have the table take care of it, but If I want it to be server side I need to handle all the logic including function to sort, icons (ascend, descent) etc.
Right now I have server side pagination working but the sorting is still being handled by the table and what happens is that the sorting is only applied on the page itself (so for the first 40 elements, being 40 my limit).
Im pretty sure I need to do all the logic, I just wanted to avoid having extra work and style everything.
2 replies
TTCTheo's Typesafe Cult
•Created by Knox on 3/5/2024 in #questions
React query useInfiniteQuery (v3) and react table (v7) for server side pagination
Anyone has every connected react-query v3 with react-table v7 ? Im trying to implement a server side paginator with infinite scrolling doing:
And everything seems ok if I implement custom button paginators like:
but have weird behavior on the custom table paginator that react-table renders:
8 replies
TTCTheo's Typesafe Cult
•Created by Knox on 2/26/2024 in #questions
Cancel query when query value reaches to 0
Im making a query that returns me a set of values and that value with decrease over time till it reaches 0. I need to fetch every 100ms the query but I want to be able to cancel the query when outdatedObjects reaches 0.
3 replies
TTCTheo's Typesafe Cult
•Created by Knox on 12/20/2023 in #questions
Open id view content from Tanstack Table with Tanstack Router
Anyone has any tip how I can render a new view in the current page of a selected item ?
So im using tanstack table, query and router and if I want to open a new page when clicking an item and receiving that Item id, everything works wonderfully.
But my idea is to have a table and open a view next to it instead of on a new url page.
This open a new page inside the id with the router perfectly. But what if I want just to open a new component or view inside the same page ? Anyone has a tip for this ?
Any tip appreciated.
41 replies
Release Go app with Docker and godotenv
I have this function that I use on my server setup to load the .env variable and on my main.go I do a simple load
Locally it works but when hosting with a Dockerfile the app crashes because it can't load the env variable
The app is deployed but eventually crashes with
Any clue ? I know this isn't a railway problem more but any feedback would be appreciated.
11 replies
TTCTheo's Typesafe Cult
•Created by Knox on 6/5/2023 in #questions
Image component not displaying images
Hey. So using NExtJS with the app directory, I have a card component with
Where the source of the card is this object:
Images is inside the public folder. Any tip on why the images aren't being rendered ?
3 replies
TTCTheo's Typesafe Cult
•Created by Knox on 3/29/2023 in #questions
Vite config with playwright-ct
on the project im working we are using absolute paths so..
~/folder/to/path
And im currently having this error:
`
Ive tried going through the simplest steps and following the documentation but so far nothing works when I run the tests.
This is my vite config (sorry, too much code)
https://pastebin.com/QtAGwZm1
This is my playwright-config:
https://pastebin.com/PQ9TyLZD
Any tip please?
1 replies
TTCTheo's Typesafe Cult
•Created by Knox on 3/27/2023 in #questions
Jotai migration from v1 to v2
Im trying to create an hook with useHydrateAtoms to reuse in different components:
And when using it on the component
Im getting this error:
Any tip?
1 replies
TTCTheo's Typesafe Cult
•Created by Knox on 3/21/2023 in #questions
Vite config with absolute paths
Im trying to make an e2e test for my components and im using absolute paths like
On my vite config I have this alias
And yet while running the test for a specific component i'm getting an error related to this absolute paths
Any idea ?
2 replies
TTCTheo's Typesafe Cult
•Created by Knox on 12/31/2022 in #questions
Get session data inside a mutation
Hello. So im trying to create a profile inside a user that is already logged in.
So the flow is Create User => Login => Create User Profile Inside the app.
My Models:
Im failing to understand how do I get the session that is logged .. or do I even need it ?
19 replies
TTCTheo's Typesafe Cult
•Created by Knox on 12/13/2022 in #questions
Credentials Provider session always return null
So im trying to make the login page work with email and password from the DB and when i click to submit the values im always having the session as null. This is what im doing:
So on my signin page i invoke the signIn method:
result returns:
5 replies
TTCTheo's Typesafe Cult
•Created by Knox on 12/10/2022 in #questions
Good idea to mix prisma and trpc on the [...nextauth].ts file or should call a function from
So I have something like this:
Its my first time using NextAuth and im thinking if doing something like this inside this file is a good idea or if this logic should be inside trpc method ?
Can anyone give me any tip / idea please?
2 replies
TTCTheo's Typesafe Cult
•Created by Knox on 12/8/2022 in #questions
i18next bold strings
Anyone has a better (working) solution for this ?
I basically want to pass the firstScore as bold but its not working this way or on the string itself
1 replies
TTCTheo's Typesafe Cult
•Created by Knox on 12/6/2022 in #questions
Sort imports
So using the create-t3-app im using the https://www.npmjs.com/package/eslint-plugin-simple-import-sort lib to sort my exports because it freaks me out to have these imports unsorted.
And i extended my eslint config as follows:
Yet the sort isnt working. Anyone ?
1 replies