kiliman / remix-flat-routes

Remix package to define routes using the flat-routes convention
MIT License
640 stars 22 forks source link

Migrate existing routing script does not work #77

Closed alexhoo closed 9 months ago

alexhoo commented 9 months ago

I'm in the root folder of my project and I'm facing this result when i try to run the script:

 npx migrate-flat-routes './app/routes' './app/flatroutes' --convention=flat-folders

Output

node:internal/fs/utils:347
    throw err;
    ^

Error: ENOENT: no such file or directory, scandir 'app/app/routes'
    at Object.readdirSync (node:fs:1452:3)
    at visitFiles (/Users/xxx/node_modules/@remix-run/v1-route-convention/dist/index.js:229:47)
    at createRoutesFromFolders (/Users/xxx/node_modules/@remix-run/v1-route-convention/dist/index.js:59:3)
    at migrate (/Users/xxx/node_modules/remix-flat-routes/dist/migrate.js:35:70)
    at main (/Users/xxx/node_modules/remix-flat-routes/dist/cli.js:61:27)
    at Object.<anonymous> (/Users/xxx/scouting-tool/node_modules/remix-flat-routes/dist/cli.js:29:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: 'app/app/routes'
}

Node.js v18.16.1
kiliman commented 9 months ago

I think I may have broken the migration script. I think I'll roll back to a previous version and have you try that. Sorry for the inconvenience.

elledienne commented 9 months ago

@kiliman I'd also be happy to test any fix to this, if helpful

kiliman commented 9 months ago

This has been fixed in v0.6.0. Please take a look and let me know how it goes.

alexhoo commented 9 months ago

It is working like a charm! Thanks

elledienne commented 8 months ago

Confirmed, works perfectly, thank you 🙏