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

1.12 ENOENT: no such file or directory referencing outes instead of routes #5322

Closed
1 task done
sockthedev opened this issue Jan 31, 2023 · 23 comments · Fixed by #5228
Closed
1 task done

1.12 ENOENT: no such file or directory referencing outes instead of routes #5322

sockthedev opened this issue Jan 31, 2023 · 23 comments · Fixed by #5228
Assignees

Comments

@sockthedev
Copy link

What version of Remix are you using?

1.12.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  • Create a Remix instance selecting the "Remix App Server" option
  • Run remix dev

The following error occurs;

TypeError: Cannot read properties of undefined (reading 'remixRequestHandlerPath')
    at requestHandler (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/@remix-run+server-runtime@1.12.0/node_modules/@remix-run/server-runtime/dist/server.js:38:94)
    at /Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/@remix-run+express@1.12.0_express@4.18.2/node_modules/@remix-run/express/dist/server.js:39:28
    at /Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/@remix-run+serve@1.12.0/node_modules/@remix-run/serve/dist/index.js:47:7
    at Layer.handle [as handle_request] (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/route.js:144:13)
    at next (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/route.js:140:7)
    at next (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/route.js:140:7)
    at next (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/route.js:140:7)
    at next (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/route.js:140:7)
    at next (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/route.js:140:7)

Expected Behavior

The dev server executes as before.

Actual Behavior

An error occurs on dev server load.

@machour
Copy link
Collaborator

machour commented Jan 31, 2023

I'm not seeing this problem on my side, having just created a new project using yarn create remix and picking all the default options.

Could you detail the exact steps you're using to create the app?

@machour machour added the needs-response We need a response from the original author about this issue/PR label Jan 31, 2023
@sockthedev
Copy link
Author

I've tried to recreate with a new init and I can't seem to. But I can't fix my current instance either. I've deleted the package lock file and node modules, and can't see why or what is causing this issue.

Another strange issue. I can't build either;

Build failed with 1 error:
error: ENOENT: no such file or directory, open '/Users/sean/sockthedev/code/hivemind-tales/app/outes/_index/index.tsx'
Error
    at Object.onCompileFailure (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/@remix-run+dev@1.12.0_@r
emix-run+serve@1.12.0/node_modules/@remix-run/dev/dist/cli/commands.js:180:13)
    at Object.compile (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/@remix-run+dev@1.12.0_@remix-run+
serve@1.12.0/node_modules/@remix-run/dev/dist/compiler/remixCompiler.js:34:134)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.build (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/@remix-run+dev@1.12.0_@remix-
run+serve@1.12.0/node_modules/@remix-run/dev/dist/compiler/build.js:33:3)
    at async Object.build (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/@remix-run+dev@1.12.0_@remix-
run+serve@1.12.0/node_modules/@remix-run/dev/dist/cli/commands.js:175:3)
    at async Object.run (/Users/sean/sockthedev/code/hivemind-tales/node_modules/.pnpm/@remix-run+dev@1.12.0_@remix-ru
n+serve@1.12.0/node_modules/@remix-run/dev/dist/cli/run.js:449:7)
 ELIFECYCLE  Command failed with exit code 1.
ERROR: "build:remix" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.

If you look at the log it looks like the r is missing from the /routes/ in the filesystem path.

I've pushed up this repo. It's pretty close to vanilla Remix. All I've done is add basic tailwind config as per your docs, opted into v2 route convention, and created a couple of super simple components.

Are you able to run the following steps;

@madispuk
Copy link

Same here. I'm using remix with express.

server-runtime/dist/server.js:38

// special __REMIX_ASSETS_MANIFEST endpoint for checking if app server serving up-to-date routes and assets
    let {
      unstable_dev
    } = build.future;
    if (mode$1 === "development" && unstable_dev !== false && url.pathname === (unstable_dev.remixRequestHandlerPath ?? "") + "/__REMIX_ASSETS_MANIFEST") {

Looks like this build.future.unstable_dev is undefined by default. So:

unstable_dev.remixRequestHandlerPath

should be:

unstable_dev?.remixRequestHandlerPath

or something. This PR:
#5243

@github-actions github-actions bot removed the needs-response We need a response from the original author about this issue/PR label Jan 31, 2023
@madispuk
Copy link

I had two dev dependencies which I forgot to update. This fixed the issue.

yarn add -D @remix-run/dev
yarn add -D @remix-run/eslint-config

@machour
Copy link
Collaborator

machour commented Jan 31, 2023

@sockthedev I'm 99% sure that you have an unaligned remix dependency, like @madispuk had.
Please check you package-lock.json file, and see if all remix packages are indeed on 1.12.0

You can do grep @remix package-lock.json to verify this

@machour machour added the needs-response We need a response from the original author about this issue/PR label Jan 31, 2023
@sockthedev
Copy link
Author

sockthedev commented Jan 31, 2023

Hmmm, I was hopeful after that comment but the grep appears fine?

hivemind-tales on  main via  v16.19.0 took 2s 
❯ grep remix pnpm-lock.yaml
  '@remix-run/dev': ^1.12.0
  '@remix-run/eslint-config': ^1.12.0
  '@remix-run/node': ^1.12.0
  '@remix-run/react': ^1.12.0
  '@remix-run/serve': ^1.12.0
  '@remix-run/node': 1.12.0
  '@remix-run/react': 1.12.0_biqbaboplfbrettd7655fr4n2y
  '@remix-run/serve': 1.12.0
  '@remix-run/dev': 1.12.0_@remix-run+serve@1.12.0
  '@remix-run/eslint-config': 1.12.0_6phwajf43xwwgpkdgjffawkphy
  /@remix-run/dev/1.12.0_@remix-run+serve@1.12.0:
      '@remix-run/serve': ^1.12.0
      '@remix-run/serve':
      '@remix-run/serve': 1.12.0
      '@remix-run/server-runtime': 1.12.0
  /@remix-run/eslint-config/1.12.0_6phwajf43xwwgpkdgjffawkphy:
  /@remix-run/express/1.12.0_express@4.18.2:
      '@remix-run/node': 1.12.0
  /@remix-run/node/1.12.0:
      '@remix-run/server-runtime': 1.12.0
      '@remix-run/web-fetch': 4.3.2
      '@remix-run/web-file': 3.0.2
      '@remix-run/web-stream': 1.0.3
  /@remix-run/react/1.12.0_biqbaboplfbrettd7655fr4n2y:
      '@remix-run/router': 1.3.1
  /@remix-run/router/1.3.1:
  /@remix-run/serve/1.12.0:
      '@remix-run/express': 1.12.0_express@4.18.2
  /@remix-run/server-runtime/1.12.0:
      '@remix-run/router': 1.3.1
  /@remix-run/web-blob/3.0.4:
      '@remix-run/web-stream': 1.0.3
  /@remix-run/web-fetch/4.3.2:
      '@remix-run/web-blob': 3.0.4
      '@remix-run/web-form-data': 3.0.4
      '@remix-run/web-stream': 1.0.3
  /@remix-run/web-file/3.0.2:
      '@remix-run/web-blob': 3.0.4
  /@remix-run/web-form-data/3.0.4:
  /@remix-run/web-stream/1.0.3:
      '@remix-run/router': 1.3.1
      '@remix-run/router': 1.3.1

My package.json dependencies;

{
  "dependencies": {
    "@remix-run/node": "^1.12.0",
    "@remix-run/react": "^1.12.0",
    "@remix-run/serve": "^1.12.0",
    "isbot": "^3.6.5",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@remix-run/dev": "^1.12.0",
    "@remix-run/eslint-config": "^1.12.0",
    "@types/react": "^18.0.25",
    "@types/react-dom": "^18.0.8",
    "eslint": "^8.27.0",
    "npm-run-all": "^4.1.5",
    "prettier": "^2.8.3",
    "tailwindcss": "^3.2.4",
    "typescript": "^4.9.5"
  }
}

Versions;

hivemind-tales on  main via  v16.19.0 
❯ pnpm --version              
7.26.2

hivemind-tales on  main via  v16.19.0 
❯ node --version   
v16.19.0

macOS 12.6.1 (Monterey)

@iamriot-dev
Copy link

I'm running into a similar issue. I upgraded an existing project to 1.12.0 and can no longer dev/build. It seems to be connected to the v2_routeConvention option.

With a fresh new project, the moment I turn on v2_routeConvention, I get the same error as my existing project:

✘ [ERROR] [plugin browser-route-module] ENOENT: no such file or directory, open '/Users/admin/projects/remix-test/app/outes/_index.tsx'

It will lists all the routes files correctly but with the wrong path. The build does complete when I rename the routes folder to outes, but loads blank pages when run.

@machour
Copy link
Collaborator

machour commented Jan 31, 2023

Shot in the dark: could you both add @remix-run/server-runtime: ^1.12.0 in your dev dependencies and see if it fixes the issue ?

Would totally appreciate a public repository reproducing the issue

@sockthedev
Copy link
Author

Shall try that, here is a public repository in the interim;

https://github.com/sockthedev/hive-mind-tales

@machour
Copy link
Collaborator

machour commented Jan 31, 2023

Shall try that, here is a public repository in the interim;

Since I never used pnpm, would you mind updating the README with the actual commands to run using pnpm? 🙏🏼

@sockthedev
Copy link
Author

Sure, I'll update it. The commands are;

pnpm install
pnpm build

@sockthedev
Copy link
Author

I even tried some resolutions for good measure;

{
  "resolutions": {
    "@remix-run/dev": "1.12.0",
    "@remix-run/eslint-config": "1.12.0",
    "@remix-run/node": "1.12.0",
    "@remix-run/react": "1.12.0",
    "@remix-run/serve": "1.12.0",
    "@remix-run/server-runtime": "1.12.0"
  }
}

But still get the following build error, similar to @iamriot-dev the "routes" path is being interpreted as outes by the compiler.

> @ build:remix /Users/sean/sockthedev/code/hivemind-tales
> remix build

Building Remix app in production mode...

✘ [ERROR] [plugin browser-route-module] ENOENT: no such file or directory, open '/Users/sean/sockthedev/code/hivemind-tales/app/outes/_index/index.tsx'

@iamriot-dev
Copy link

iamriot-dev commented Jan 31, 2023

Here's the fresh project I was testing and having issues with: https://github.com/iamriot-dev/test-remix. For what it's worth, I'm using Yarn with PnP instead of pnpm.

By the way, you can see the misinterpretation of the paths present itself in the remix routes cli command as well:

<Routes>
  <Route file="root.tsx">
    <Route path="index" file="outes/_index.tsx" />
    <Route path="ested/page" file="outes/nested.page.tsx" />
  </Route>
</Routes>

It is affecting both the file path and route path.

@github-actions github-actions bot removed the needs-response We need a response from the original author about this issue/PR label Jan 31, 2023
@sapter
Copy link

sapter commented Jan 31, 2023

I've also just ran into this issue and it turned out it was due to unaligned remix dependencies.

@haines
Copy link
Contributor

haines commented Jan 31, 2023

Is

TypeError: Cannot read properties of undefined (reading 'remixRequestHandlerPath')

related to

error: ENOENT: no such file or directory, open '/Users/sean/sockthedev/code/hivemind-tales/app/outes/_index/index.tsx'

or are these two separate issues?

I have also raised the outes issue (#5324) and have pushed a fix (#5327). Here's a workaround using patch-package.

@sockthedev
Copy link
Author

or are these two separate issues?

I think the first error is a symptom of the issue when running the dev server.

@haines
Copy link
Contributor

haines commented Jan 31, 2023

I think the first error is a symptom of the issue when running the dev server.

Cool, in that case I've closed #5324 as a duplicate and linked #5327 as closing this issue instead 🙂

@sockthedev
Copy link
Author

Awesome, thanks for jumping on this issue so fast!

@imprashast
Copy link

I can confirm the same behaviour. It trims the first word of our route, npx remix routes shows:

<Route path="ndex" file="outes/index.tsx" />

@adonaicandido
Copy link

adonaicandido commented Jan 31, 2023

I can confirm the same behavior as well. Updated an existing project to 1.12.0 and it doesn't dev/build.

Created a new project using indie stack, everything works great, expect if I try to use the v2 routes.

@mcansh mcansh self-assigned this Jan 31, 2023
@gielcobben

This comment was marked as duplicate.

@pcattori pcattori changed the title Regression in 1.12.0 - can't run remix dev on a "Remix App Server" instance 1.12 ENOENT: no such file or directory referencing outes instead of routes Feb 2, 2023
@pcattori pcattori changed the title 1.12 ENOENT: no such file or directory referencing outes instead of routes 1.12 ENOENT: no such file or directory referencing outes instead of routes Feb 2, 2023
itsMapleLeaf added a commit to itsMapleLeaf/charge-worlds that referenced this issue Feb 5, 2023
@MichaelDeBoey
Copy link
Member

Closed by #5228

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-a024557-20230207 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

TooTallNate added a commit to vercel/vercel that referenced this issue Feb 23, 2023
There were some fixes to thier new v2 filesystem routing that this will
help with.

Related to remix-run/remix#5322 and remix-run/remix#5228.
kodiakhq bot pushed a commit to vercel/vercel that referenced this issue Feb 23, 2023
There were some fixes to thier new v2 filesystem routing that this will help with.

Related to remix-run/remix#5322 and remix-run/remix#5228.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet