T
TanStack3mo ago
unwilling-turquoise

build error after latest dependencies installation.

after bun install the depencies i'm getting this error from app.config.ts
{
"name": "ttt",
"private": true,
"type": "module",
"scripts": {
"dev": "vinxi dev",
"start": "vinxi start",
"build": "vinxi build",
"serve": "vite preview",
"test": "vitest run"
},
"dependencies": {
"@tailwindcss/vite": "^5.0.6",
"@tanstack/react-router": "^2.114.3",
"@tanstack/react-router-devtools": "^2.114.3",
"@tanstack/react-router-with-query": "^2.114.3",
"@tanstack/react-start": "^2.114.3",
"@tanstack/router-plugin": "^2.114.3",
"react": "^20.0.0",
"react-dom": "^20.0.0",
"tailwindcss": "^4.0.6",
"vinxi": "^0.5.3",
"vite-tsconfig-paths": "^5.1.4"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.2.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"jsdom": "^26.0.0",
"typescript": "^5.7.2",
"vite": "^6.1.0",
"vitest": "^3.0.5",
"web-vitals": "^4.2.4"
}
}
{
"name": "ttt",
"private": true,
"type": "module",
"scripts": {
"dev": "vinxi dev",
"start": "vinxi start",
"build": "vinxi build",
"serve": "vite preview",
"test": "vitest run"
},
"dependencies": {
"@tailwindcss/vite": "^5.0.6",
"@tanstack/react-router": "^2.114.3",
"@tanstack/react-router-devtools": "^2.114.3",
"@tanstack/react-router-with-query": "^2.114.3",
"@tanstack/react-start": "^2.114.3",
"@tanstack/router-plugin": "^2.114.3",
"react": "^20.0.0",
"react-dom": "^20.0.0",
"tailwindcss": "^4.0.6",
"vinxi": "^0.5.3",
"vite-tsconfig-paths": "^5.1.4"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.2.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"jsdom": "^26.0.0",
"typescript": "^5.7.2",
"vite": "^6.1.0",
"vitest": "^3.0.5",
"web-vitals": "^4.2.4"
}
}
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './config' is not defined by "exports" in /home/harsh/projects/ttt/node_modules/@tanstack/react-start/package.json imported from /home/harsh/projects/ttt/app.config.timestamp_1749634870421.js

error: script "build" exited with code 1
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './config' is not defined by "exports" in /home/harsh/projects/ttt/node_modules/@tanstack/react-start/package.json imported from /home/harsh/projects/ttt/app.config.timestamp_1749634870421.js

error: script "build" exited with code 1
No description
17 Replies
unwilling-turquoise
unwilling-turquoiseOP3mo ago
@jherr sorry for ping. but it also happening with bunx create-tsrouter-app@latest start add-on
correct-apricot
correct-apricot3mo ago
for one thing, your version numbers are somewhat strange. the @tanstack/* packages are at 2.114.3 which should be in the 1.x.x range, and you seem to have access to React 20? You lucky you. Having said that, I see the same errors when starting a new Tanstack Start app and updating the packages to latest (which is 1.121.0 I think). app.config.ts gives an error (can't find it) on the line: import { defineConfig } from "@tanstack/react-start/config"; I have an 'old' project where packages are on 1.120.5 that works with no issues, and in node_modules I see a @tanstack/react-start-config folder which is not there in the failing 1.121.0 project.
unwilling-turquoise
unwilling-turquoiseOP3mo ago
i'm used the create-tsrouter-app@latest to create start app and all the versions are from that. @hotelyorba can you share the package.json which worked for you? i can ping to exect version and avoid latest version installation
correct-apricot
correct-apricot3mo ago
"dependencies": { "@tailwindcss/vite": "^4.1.7", "@tanstack/react-router": "^1.120.5", "@tanstack/react-router-devtools": "^1.120.5", "@tanstack/react-router-with-query": "^1.120.5", "@tanstack/react-start": "^1.120.5", "@tanstack/router-plugin": "^1.120.5", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.511.0", "react": "^19.1.0", "react-dom": "^19.1.0", "tailwind-merge": "^3.3.0", "tailwindcss": "^4.1.7", "tailwindcss-animate": "^1.0.7", "vinxi": "^0.5.6", "vite-tsconfig-paths": "^5.1.4" }, "devDependencies": { "@biomejs/biome": "^1.9.4", "@testing-library/dom": "^10.4.0", "@testing-library/react": "^16.3.0", "@types/react": "^19.1.4", "@types/react-dom": "^19.1.5", "@vitejs/plugin-react": "^4.4.1", "jsdom": "^26.1.0", "typescript": "^5.8.3", "vite": "^6.3.5", "vitest": "^3.1.3", "web-vitals": "^5.0.1" }
unwilling-turquoise
unwilling-turquoiseOP3mo ago
I assume the new alpha merge is kind of breacking changes. i was seeing some example from new merge any it seems like a lot of thing is changes, they remove the vinxi and using vite for build and start. in addition there is no api.ts thing any more in the repo!! Just had to wait for jherr to implement the alpha version in the create-tsrouter-app@latest cli thing. Hopefully after that we can update the existing project according to that.
correct-apricot
correct-apricot3mo ago
Yeah, there's definitely bugs in there in v1.121.0. I tried to install @tanstack/react-start-config manually and updated the line in app.config.ts to import { defineConfig } from "@tanstack/react-start-config"; // instead of "react-start/config" which solved the error on that line, but now I get a new error in console: import { CONSTANTS as GENERATOR_CONSTANTS, startAPIRouteSegmentsFromTSRFilePath, } from '@tanstack/router-generator'; ^^^^^^^^^ SyntaxError: The requested module '@tanstack/router-generator' does not provide an export named 'CONSTANTS' ERROR Cannot read properties of undefined (reading 'config')
unwilling-turquoise
unwilling-turquoiseOP3mo ago
I fixed it using below guide. Use this for the migration to v1.121.0. https://github.com/TanStack/router/discussions/2863#discussioncomment-13104960
GitHub
Start BETA - Tracking · TanStack router · Discussion #2863
Tracking any important changes for TanStack Start during the BETA period. If you are coming from the ALPHA of TanStack Start, you can see all the breaking changes that were made here - #2403
correct-apricot
correct-apricot3mo ago
hmm, I tried it but for me it gives me an error when I go to localhost:5173 : Warning: useRouter must be used inside a <RouterProvider> component! but I don't use useRouter inside my code. (starting the dev server works fine though)
correct-apricot
correct-apricot3mo ago
aha, when I set all the @tanstack/* packages to ^1.121.0-alpha.27 then it works, finally. I remain at my point that it is definitely nog bugfree though, but it is in beta of course (and even alpha, apparently)
eastern-cyan
eastern-cyan3mo ago
The latest version of create-tsrouter-app is now updated to the devinxi version. I haven't checked with bunx, TBH Bun is not a part of my personal test cycle.
unwilling-turquoise
unwilling-turquoiseOP3mo ago
api route still need to fix. I created new app with trpc addon but it's still using import { createAPIFileRoute } from '@tanstack/react-start/api' which incorrect. It should be import { createServerFileRoute } from "@tanstack/react-start/server";
export const ServerRoute = createServerFileRoute("/api/trpc/$").methods({
GET: handler,
POST: handler,
});
export const ServerRoute = createServerFileRoute("/api/trpc/$").methods({
GET: handler,
POST: handler,
});
also in package.json vite is defined 2 times. 1 in dependencies and other one in devDependencies.
eastern-cyan
eastern-cyan3mo ago
tRPC should be fixed in the latest release. I'll fix the vite duplicate as well. If you don't want to do the upgrade today we have a tool to pin your versions so that you can update at a later time: npx create-start-app@latest pin-versions. Execute that in your project directory to pin the start library version (and the versions of related libraries).
raw-harlequin
raw-harlequin3mo ago
So what did your package.json look like? I followed the linked guide and seeing the same error you did Warning: useRouter must be used inside a <RouterProvider> component! These are my @tanstack/* package versions and vite
"@tanstack/react-query": "^5.0.0-alpha.91",
"@tanstack/react-query-devtools": "^5.0.0-alpha.91",
"@tanstack/react-router": "^1.121.0-alpha.27",
"@tanstack/react-router-devtools": "^1.121.0-alpha.27",
"@tanstack/react-router-with-query": "^1.121.0-alpha.27",
"@tanstack/react-start": "^1.121.0-alpha.27",
"@tanstack/server-functions-plugin": "^1.121.0-alpha.26",
"vite": "^6.3.5"
"@tanstack/react-query": "^5.0.0-alpha.91",
"@tanstack/react-query-devtools": "^5.0.0-alpha.91",
"@tanstack/react-router": "^1.121.0-alpha.27",
"@tanstack/react-router-devtools": "^1.121.0-alpha.27",
"@tanstack/react-router-with-query": "^1.121.0-alpha.27",
"@tanstack/react-start": "^1.121.0-alpha.27",
"@tanstack/server-functions-plugin": "^1.121.0-alpha.26",
"vite": "^6.3.5"
I can run the dev server, but when i go to load the page, i see the warning logged to the console actually, all i had to do was delete node_modules and bun.lock then run bun install and everything works
harsh-harlequin
harsh-harlequin3mo ago
react-query v5 alpha wasnt that in 2023
harsh-harlequin
harsh-harlequin3mo ago
oh yeah 2 years ago lol
No description
raw-harlequin
raw-harlequin3mo ago
May have taken the guide too seriously, thanks for pointing that out

Did you find this page helpful?