Skip to content

Commit c6bd449

Browse files
authored
fix(create): upgrade to Vite 8 and fix useStore selector in AI add-on (#428)
- Upgrade vite from ^7.3.1 to ^8.0.0 and @vitejs/plugin-react to ^6.0.1 - Replace vite-tsconfig-paths plugin with native resolve.tsconfigPaths - Pass required selector function to useStore in AI assistant component Made-with: Cursor
1 parent 44ef1ad commit c6bd449

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.changeset/vite8-usestore-fix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/create': patch
3+
---
4+
5+
Upgrade to Vite 8 and replace `vite-tsconfig-paths` plugin with native `resolve.tsconfigPaths` option. Fix `useStore` call in AI assistant add-on to pass required selector function.

packages/create/src/frameworks/react/add-ons/ai/assets/src/components/demo-AIAssistant.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function Messages({ messages }: { messages: ChatMessages }) {
7979
}
8080

8181
export default function AIAssistant() {
82-
const isOpen = useStore(showAIAssistant)
82+
const isOpen = useStore(showAIAssistant, (state) => state)
8383
const { messages, sendMessage } = useGuitarRecommendationChat()
8484
const [input, setInput] = useState('')
8585

packages/create/src/frameworks/react/project/base/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@
2828
"@testing-library/react": "^16.3.0",
2929
"@types/react": "^19.2.0",
3030
"@types/react-dom": "^19.2.0",
31-
"@vitejs/plugin-react": "^5.1.4",
31+
"@vitejs/plugin-react": "^6.0.1",
3232
"jsdom": "^28.1.0",
3333
"typescript": "^5.9.2",
34-
"vite": "^7.3.1",
35-
"vite-tsconfig-paths": "^5.1.4",
34+
"vite": "^8.0.0",
3635
"vitest": "^3.0.5"
3736
},
3837
"pnpm": {
39-
"onlyBuiltDependencies": ["esbuild", "lightningcss"]
38+
"onlyBuiltDependencies": [
39+
"esbuild",
40+
"lightningcss"
41+
]
4042
}
4143
}

packages/create/src/frameworks/react/project/base/vite.config.ts.ejs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { defineConfig } from 'vite'
22
import { devtools } from '@tanstack/devtools-vite'
3-
import tsconfigPaths from 'vite-tsconfig-paths'
43
<% if (addOnEnabled.paraglide) { -%>
54
import { paraglideVitePlugin } from "@inlang/paraglide-js"
65
<% } -%>
@@ -15,12 +14,12 @@ import tailwindcss from "@tailwindcss/vite"
1514
<% } %>
1615

1716
const config = defineConfig({
17+
resolve: { tsconfigPaths: true },
1818
plugins: [devtools(), <% if (addOnEnabled.paraglide) { %>paraglideVitePlugin({
1919
project: './project.inlang',
2020
outdir: './src/paraglide',
2121
strategy: ['url', "baseLocale"],
2222
}), <% } %><% for(const integration of integrations.filter(i => i.type === 'vite-plugin')) { %><%- integrationImportCode(integration) %>,<% } %>
23-
tsconfigPaths({ projects: ['./tsconfig.json'] }),
2423
tailwindcss(),
2524
<% if (routerOnly) { %>tanstackRouter({ target: 'react', autoCodeSplitting: true }),<% } else { %>tanstackStart(),<% } %>
2625
viteReact(<% if (addOnEnabled.compiler) { %>{

0 commit comments

Comments
 (0)