8000 `server/api` being a file gives error · Issue #15752 · nuxt/nuxt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

server/api being a file gives error #15752

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

Closed
nopeless opened this issue Nov 29, 2022 · 2 comments
Closed

server/api being a file gives error #15752

nopeless opened this issue Nov 29, 2022 · 2 comments

Comments

@nopeless
Copy link
Contributor

Environment

❯ nuxi info
Nuxi 3.0.0 17:10:38
17:10:40
RootDir: /home/projects/nuxt-starter-3rghgt 17:10:40
Nuxt project info: 17:10:40


  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0
  • Nitro Version: 1.0.0
  • Package Manager: npm@7.17.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-3rghgt?file=server%2Fapi

Describe the bug

When server/api is a file it errors without giving helpful information

Additional context

Accidentally discovered it.

Very low priority bug

Logs

No response

@andreygmc
Copy link

Hello. I tried to reproduce and it seems to me that this log is quite helpful to understand the problem:

 ERROR  [unhandledRejection] ENOTDIR: not a directory, stat '/Users/andrey/nuxt-proj/server/api/**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}'                                           22:17:36

    at async Object.stat (node:internal/fs/promises:1036:18)
    at async isType (node_modules/path-type/index.js:10:17)
    at async node_modules/globby/index.js:39:4
    at async Promise.all (index 0)
    at async directoryToGlob (node_modules/globby/index.js:38:16)
    at async Promise.all (index 0)
    at async node_modules/globby/index.js:192:8
    at async Promise.all (index 0)
    at async Promise.all (index 0)
    at async node_modules/globby/index.js:224:6

ℹ Restarting Nuxt due to error: Error: ENOTDIR: not a directory, stat '/Users/andrey/nuxt-proj/server/api/**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}'

@pi0
Copy link
Member
pi0 commented Mar 24, 2025

I have made an upstream issue to improve DX: nitrojs/nitro#3248

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

5 participants
0