TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

When i tried to create a component and saved and the loading screen appeared it shows below message. there is an file creates as the component saves that was seen saved in under component folder/faq/faq.json when it removes it works well.

The restart is taking longer than expected

The server should have restarted, please check your logs in the terminal.

TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined ││ at Object.join (node:path:433:7) ││ at C:\albert\work\tranquil\strapi\tranquil\node_modules@strapi\strapi\dist\core\loaders\components.js:17:31 ││ at Array.forEach () ││ at C:\albert\work\tranquil\strapi\tranquil\node_modules@strapi\strapi\dist\core\loaders\components.js:14:32 ││ at Array.reduce () ││ at Object.loadComponents ││ (C:\albert\work\tranquil\strapi\tranquil\node_modules@strapi\strapi\dist\core\loaders\components.js:13:27) ││ at async Strapi.loadComponents (C:\albert\work\tranquil\strapi\tranquil\node_modules@strapi\strapi\dist\Strapi.js:320:23) ││ at async Promise.all (index 6) ││ at async Strapi.register (C:\albert\work\tranquil\strapi\tranquil\node_modules@strapi\strapi\dist\Strapi.js:341:5) ││ at async Strapi.load (C:\albert\work\tranquil\strapi\tranquil\node_modules@strapi\strapi\dist\Strapi.js:425:5

2 Likes

We’re getting a similar error when trying to boot from dev. It only happens on Windows clients, MacOS clients do not experience this issue, nor does it pop up in our ubuntu production server.

3 Likes

Looks like we just need to update Strapi!

Windows only: Strapi 4.25.3: Server crashes when creating a Component · Issue #20730 · strapi/strapi (github.com)

1 Like

Yeah, I think its only in windows but it worked when downgraded to “@strapi/strapi”: “4.13.5”,

1 Like

It looks like there’s an error in your code where a function or method expects a string for the “path” argument, but instead, it’s getting undefined. Make sure you’re passing a valid string value to the function or method. Here’s a simple way to address this issue:

  1. Check your code: Find where the “path” argument is being used.
  2. Ensure a string is provided: Verify that you are passing a valid string (like "path/to/file") and not undefined.
1 Like