attempt to fix build issues#985
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR fixes a Next.js build error by correcting the redirect configuration syntax in next.config.ts. The change removes the invalid key field from two redirect rules that handle domain redirections from simstudio.ai and www.simstudio.ai to www.sim.ai.
The issue stems from incorrect Next.js redirect API usage. When using has conditions with type: 'host', the key field is not needed and is actually invalid syntax - hostname matching is implicit when the type is 'host'. The previous configuration incorrectly included key: 'host' which was causing build failures.
Additionally, the PR adds TypeScript as const type assertions to the type field values. This ensures TypeScript treats these as literal types rather than generic strings, which aligns with Next.js type requirements and prevents potential type mismatch issues.
This configuration change is part of the main application's routing setup (apps/sim/) within the monorepo structure, ensuring proper domain redirection for the production deployment.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it fixes invalid configuration syntax
- Score reflects a straightforward configuration fix with clear reasoning and low complexity
- No files require special attention - the change is isolated to Next.js configuration
1 file reviewed, no comments
attempt to fix build issues (#985)
attempt to fix build issues (simstudioai#985)
Summary
Remove key field to make it valid route for redirect.
Type of Change
Testing
Must test by attempting deploy.
Checklist