ckastbjerg / next-type-safe-routes

Never should your users experience broken links again!
MIT License
70 stars 5 forks source link

Types not saved in the correct place on windows #27

Closed osdiab closed 3 years ago

osdiab commented 3 years ago

~I still need to figure out why this is happening, but~ my teammate on a project is experiencing a strange issue where the @types folder is being placed in the src/pages directory instead of the src directory for him. Will take a look at the code and chat with him more to see if I can find out what might be going on. Related to #18

EDIT: turns out i was right, slashes are reversed in windows:

{
  pagesDir: 'C:\\Users\\gus\\Documents\\dev\\spinach\\web-app\\src\\pages'
}

the code needs to be tolerant of that, and also probably should not just be a regex replace (if /pages is anywhere else in the path it'll break)

osdiab commented 3 years ago

I suspect it might be that he's on windows and the slashes are reversed? But double checking by asking him to print out what the pagesDir value is

airtonix commented 2 years ago

this is only true if you use cmd.exe .

most people will now be using powershell by default or wsl2