Skip to content
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

Remix errors when the data-build/routes folder is missing #77

Closed
zzzzBov opened this issue Jan 2, 2021 · 1 comment
Closed

Remix errors when the data-build/routes folder is missing #77

zzzzBov opened this issue Jan 2, 2021 · 1 comment

Comments

@zzzzBov
Copy link

zzzzBov commented Jan 2, 2021

Details

I'm setting up a new project and I haven't defined any route data yet. Running tsc -b generates the data-build folder, but not the routes subfolder because there are no files yet.

Running npm run dev gives the following error:

[0] Error: ENOENT: no such file or directory, scandir '...project path...\data-build\routes'
[0]     at Object.readdirSync (node:fs:1044:3)
[0]     at visitFiles (...project path...\node_modules\@remix-run\core\routesConvention.js:109:47)
[0]     at Object.defineConventionalRoutes (...project path...\node_modules\@remix-run\core\routesConvention.js:69:3)
[0]     at Object.readConfig (...project path...\node_modules\@remix-run\core\config.js:51:35)
[0]     at Object.run (...project path...\node_modules\@remix-run\core\commands.js:36:31)
[0]     at Object.<anonymous> (...project path...\node_modules\@remix-run\cli\index.js:47:19)
[0]     at Module._compile (node:internal/modules/cjs/loader:1108:14)
[0]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
[0]     at Module.load (node:internal/modules/cjs/loader:973:32)
[0]     at Function.Module._load (node:internal/modules/cjs/loader:813:14)
[0] remix run exited with code 1

From digging into @remix-run/core/routesConvention.js it looks like adding an fs.existsSync(dir) check to visitFiles would be enough to handle the error (and maybe add a console warning to indicate that the directory couldn't be found).

@machour
Copy link
Collaborator

machour commented Mar 16, 2022

Not applicable anymore

@machour machour closed this as completed Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants