infelipe Gomes
infelipe Gomes
WWasp
Created by infelipe Gomes on 4/15/2025 in #🙋questions
How to refresh table data after deleting a record in Wasp?
Hey! I'm using Wasp with a table UI that lists records from a query. When I delete a record via a button in the table, the record is removed from the database, but the table UI doesn't update automatically. What’s the recommended way to ensure the table reflects the updated data after deletion? I'm using the default query (e.g. getTasks) and deleteTask action. Should I manually invalidate the query with React Query's queryClient.invalidateQueries, or is there a more idiomatic way to handle this in Wasp? Perhaps there is something wrong with the entities I defined in main.wasp?
18 replies
WWasp
Created by infelipe Gomes on 4/7/2025 in #🙋questions
Test fails due to unresolved "@tanstack/react-query" import
I'm trying to run a simple test using Vitest with Wasp (version 0.16.2), but I keep getting this error: [ Client!] FAIL src/tests/components/AppLayout.test.tsx [ src/tests/components/AppLayout.test.tsx ] [ Client!] Error: Failed to resolve import "@tanstack/react-query" from ".wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx". Does the file exist? [ Client!] ❯ TransformPluginContext._formatError node_modules/vitest/node_modules/vite/dist/node/chunks/dep-Dyl6b77n.js:49258:41 [ Client!] ❯ TransformPluginContext.error node_modules/vitest/node_modules/vite/dist/node/chunks/dep-Dyl6b77n.js:49253:16 [ Client!] ❯ normalizeUrl node_modules/vitest/node_modules/vite/dist/node/chunks/dep-Dyl6b77n.js:64229:23 [ Client!] ❯ async file:/home/felipe/TodoApp/node_modules/vitest/node_modules/vite/dist/node/chunks/dep-Dyl6b77n.js:64361:39 [ Client!] ❯ TransformPluginContext.transform node_modules/vitest/node_modules/vite/dist/node/chunks/dep-Dyl6b77n.js:64288:7 [ Client!] ❯ PluginContainer.transform node_modules/vitest/node_modules/vite/dist/node/chunks/dep-Dyl6b77n.js:49099:18 [ Client!] ❯ loadAndTransform node_modules/vitest/node_modules/vite/dist/node/chunks/dep-Dyl6b77n.js:51938:27 Even basic tests like expect(true).toBeTruthy(); are failing with the same issue. Has anyone run into this or know what might be causing it?
20 replies