-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Bug Report: cookie-es should be listed as a dependency in @tanstack/router-core
Description
When deploying applications that use @tanstack/router-core
on AWS Amplify Hosting, the build fails because cookie-es
is imported by the package but not listed as a dependency. This causes a runtime error in production environments.
Error Log
H3Error: Cannot find package '/var/task/node_modules/cookie-es/index.js' imported from /var/task/node_modules/@tanstack/router-core/dist/esm/ssr/headers.js
at legacyMainResolve (node:internal/modules/esm/resolve:210:26)
...
cause: Error: Cannot find package '/var/task/node_modules/cookie-es/index.js' imported from /var/task/node_modules/@tanstack/router-core/dist/esm/ssr/headers.js
Environment
- @tanstack/router-core version: Latest (via @tanstack/react-router@^1.131.36)
- Deployment Platform: AWS Amplify Hosting
- Node.js version: Node.js runtime in AWS Lambda
Reproduction Steps
- Create a new React app with TanStack Router
- Deploy to AWS Amplify Hosting
- The deployment fails with the above error
Current Workaround
Manually adding cookie-es
as a dependency in the application's package.json
:
{
"dependencies": {
"cookie-es": "^2.0.0"
}
}
Expected Behavior
cookie-es
should be listed as a dependency in @tanstack/router-core
's package.json
since the package imports it directly in /dist/esm/ssr/headers.js
.
Additional Context
- This issue was discovered while troubleshooting deployment failures on AWS Amplify
- Adding the package to Vite's
optimizeDeps.include
may also be needed for some environments
Suggested Fix
Add cookie-es
to the dependencies in @tanstack/router-core/package.json
:
{
"dependencies": {
"cookie-es": "^2.0.0"
}
}
Metadata
Metadata
Assignees
Labels
No labels