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

npm run dev -> TypeError: routeSegments.at is not a function #86

Closed
timothymalcham opened this issue May 23, 2023 · 3 comments
Closed

Comments

@timothymalcham
Copy link

timothymalcham commented May 23, 2023

Wanted to try out the stack, installed via the getting-started.md instructions. Ran the setup command, and then tried to boot up the server (without touching any files or code) and got this:

➜ npm run dev

> dev
> remix dev -c "npm run dev:server" --no-restart

TypeError: routeSegments.at is not a function
    at getRouteSegments (/Users/timothymalcham/dev/uu/node_modules/remix-flat-routes/dist/index.js:356:23)
    at getRouteInfo (/Users/timothymalcham/dev/uu/node_modules/remix-flat-routes/dist/index.js:210:25)
    at /Users/timothymalcham/dev/uu/node_modules/remix-flat-routes/dist/index.js:119:33
    at defaultVisitFiles (/Users/timothymalcham/dev/uu/node_modules/remix-flat-routes/dist/index.js:382:13)
    at defaultVisitFiles (/Users/timothymalcham/dev/uu/node_modules/remix-flat-routes/dist/index.js:379:13)
    at _flatRoutes (/Users/timothymalcham/dev/uu/node_modules/remix-flat-routes/dist/index.js:113:9)
    at flatRoutes (/Users/timothymalcham/dev/uu/node_modules/remix-flat-routes/dist/index.js:44:20)
    at Object.routes (file:///Users/timothymalcham/dev/uu/remix.config.js:22:10)
    at Object.readConfig (/Users/timothymalcham/dev/uu/node_modules/@remix-run/dev/dist/config.js:248:40)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Is there a recommended way of resolving this?

@rajeshg
Copy link
Contributor

rajeshg commented May 25, 2023

Tried reproducing this with the latest version and haven't run into this myself.
OS: Windows 10
Environment: WSL2

Based on the error log, obviously it's thrown from the remix-flat-routes package. Possibly a rare edge case, that I am having a hard time reproducing.

@timothymalcham still experiencing this?

@CarlaTeo
Copy link

I had the same problem, it was the node version.
Found the solution in the remix-flat-routes git: kiliman/remix-flat-routes#44

@timothymalcham
Copy link
Author

Ah thanks for linking that issue, @CarlaTeo. I'll upgrade node (it's been a while since I've done js/node stuff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants