-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nextjs-routes.d.ts not generated on build #182
Comments
Hey @neotrow. Thanks, there are a few interesting things here:
Could you tell me more about this? Ideally, providing a few examples? I'm curious if there are some git config recommendations or other opportunities to here decrease the incidence rate of merge conflicts
Yep, this is intentional because the file is expected to be version controlled. That said, I'm open to supporting a configuration option to generate the file in builds. |
Sorting the routes alphabetically should help reduce the chance of conflicts. |
Yeah I was curious about something like that but I'm having trouble reasoning about it. Is that primarily due to fewer same line insertions, or is there something else going on? |
hey @tatethurston sorry for my very late reply!
Unfortunatley I can't provide any examples. But in general our approach is to not check in files that can be auto generated as it leads to conflict sooner or later.
I see. One thing to note ist that the Readme says that it is generated on build: Would you be open for a PR that will generate the file on build? I haven't checked the code yet but I assume it would be fairly simple to implement? And I guess we could also make it configurable, so one can decide if it should be generated on build or not? |
I’m happy to take a look at an MR for this. And yes, let’s have this configurable, with the default continuing to be off when building for production. Separately, I’m also interested in reducing the conflict frequency. I’d like to explore the sorting method that @yangshun called out. If you want to tackle that as well, I’d appreciate it, but totally fine if not. |
I published 2.2.4-rc.1 where cli invocation eg: |
Thanks for the awesome package!
We would like to not check in the
nextjs-routes.d.ts
file because it leads to merge conflicts quite often.But than we noticed that the
nextjs-routes.d.ts
file actually doesn't get created when running a build. This can be reproduced by runningyarn build
in theexamples/typescript
project. (And deleting the existingnextjs-routes.d.ts
file beforehand)We also tried to run the cli with
yarn nextjs-routes
but noticed that this doesn't respect thenext.config.js
file and hence the build later fails because it doesn't know anything about the locales. But I think that's a known issue:#136
The text was updated successfully, but these errors were encountered: