question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The "path" argument must be of type string. Received an instance of Array/undefined

See original GitHub issue

Environment


  • Operating System: Linux
  • Node Version: v16.17.0
  • Nuxt Version: 2.16.0-27704181.7b3bab3
  • Nitro Version: 0.4.24
  • Package Manager: npm@8.15.0
  • Builder: vite
  • User Config: bridge, serverHandlers, devServerHandlers, buildModules
  • Runtime Modules: -
  • Build Modules: (), @nuxt/bridge@3.0.0-27700335.6dfc006

Reproduction

https://github.com/AndreyYolkin/nuxt-bug-path-argument

Describe the bug

When we are starting app in dev mode, something goes wrong and nuxt reporting that some package paths are broken. Some paths consist of Array, some are undefined.

Additional context

Package name in logs (@nuxt/ui-templates) appeared because I tried to wrap module resolving function in try catch to determine the broken package. Howerer, it actually didn’t help a lot

Logs

ERROR  @nuxt/ui-templates The "path" argument must be of type string. Received an instance of Array                                                                                                19:24:41

  at new NodeError (node:internal/errors:387:5)
  at validateString (node:internal/validators:121:11)
  at Object.resolve (node:path:1098:7)
  at Function.Module._nodeModulePaths (node:internal/modules/cjs/loader:642:17)
  at Function.Module._resolveFilename (node:internal/modules/cjs/loader:896:37)
  at Function.resolve (node:internal/modules/cjs/helpers:108:19)
  at resolveModule (node_modules/nuxi/dist/shared/nuxi.a3ba4610.mjs:17:31)
  at importModule (node_modules/nuxi/dist/shared/nuxi.a3ba4610.mjs:40:24)
  at loadingHandler (node_modules/nuxi/dist/chunks/dev.mjs:6727:50)
  at Server.serverHandler (node_modules/nuxi/dist/chunks/dev.mjs:6733:58)


 ERROR  [unhandledRejection] The "path" argument must be of type string. Received undefined                                                                                                         19:24:41

  at new NodeError (node:internal/errors:387:5)
  at validateString (node:internal/validators:121:11)
  at Object.resolve (node:path:1098:7)
  at pathToFileURL (node:internal/url:1496:25)
  at importModule (node_modules/nuxi/dist/shared/nuxi.a3ba4610.mjs:41:17)
  at loadingHandler (node_modules/nuxi/dist/chunks/dev.mjs:6727:50)
  at Server.serverHandler (node_modules/nuxi/dist/chunks/dev.mjs:6733:58)
  at Server.emit (node:events:525:35)
  at Server.emit (node:domain:489:12)
  at parserOnIncoming (node:_http_server:980:12)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
danielroecommented, Sep 5, 2022

I can’t reproduce with your reproduction.

https://stackblitz.com/github/AndreyYolkin/nuxt-bug-path-argument

1reaction
AndrewBogdanovTSScommented, Sep 9, 2022

OMG, I was simply missing index.vue in pages folder, what a facepalm moment 🤦‍♂️🤦‍♂️🤦‍♂️

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "path" argument must be of type string ... - Stack Overflow
I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get...
Read more >
[Fix] TypeError [ERR_INVALID_ARG_TYPE]: The “path ...
Have you run into the error “TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined”? In this story I'll go...
Read more >
[err_invalid_arg_type]: the "path" argument must be of type ...
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined at Object.
Read more >
The "path" argument must be of type string ... - SyntaxFix
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined raised when starting react app.
Read more >
Failed to start node-red. "path" argument must be of type string ...
12 May 15:01:22 - [error] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found