Closed codenoid closed 3 months ago
Also hitting this error today
Same problem here :
[ERROR] Error: Unable to build website for locale fr. [cause]: TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined
tried using typescript, with no success, it seems even when forcing the use of 3.3.2, 3.3.0 or even 3.2 I got the same error.
Would that be a dependency problem ?
I am getting the same error upon installing a fresh install and for current projects.
[ERROR] TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined
at validateString (node:internal/validators:162:11)
at Object.resolve (node:path:1101:7)
I am getting this error as well. I just created a fresh project using bunx
bunx create-docusaurus@latest my-website classic --typescript
bun run start
I'm also getting it with older versions
bunx create-docusaurus@3.1 my-website classic --typescript
bun run start
Getting the same error as well
Same issue for us as well: https://github.com/innomotics/brand-experience/actions/runs/9378506713/job/25821930424
Had no issues 2 days ago.
Getting the same error as well.
I'm getting same issue when I npm run start
either on my current project or a fresh project. Had no issues a day ago.
[INFO] Starting the development server...
[ERROR] TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined at new NodeError (node:internal/errors:405:5) at validateString (node:internal/validators:162:11) at Object.resolve (node:path:1097:7) at Object.pluginContentBlog [as plugin] (/Users/266/Documents/github/docusaurus_test/node_modules/@docusaurus/plugin-content-blog/lib/index.js:51:37)
Same problem this morning ;(
yarn build
was working for me, I pushed to github for release and the build action failed, this suggests there is a dependency that's not pinned to a version so it was ok locally and not ok when built fresh. When I then cleared my local node modules and package locks etc it also fails.
The error occurs specifically in pluginContentBlog, but this may just be the first plugin the build tries to load - I don't use the blog plugin but I do use preset-classic.
Here is an example commit triggering the error (and repo that exhibits the problem): https://github.com/webprofusion/certify-docs/commit/2d7696f6cfbdf4213d8b7915d27459074e732c5a#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
[ Edit 1] The actual line that hits a problem is indeed specific to the blog plugin:
It's trying to find options.path which is undefined (options exists and has an id 'default' but there is no path
property)
[Edit 2]
My config only uses blogs in docusaurus.config.js and adding false
config does let it skip past the unused plugin but eventually it hits a property that's undefined elsewhere in the next plugin (in my case additionalLanguages
of the themeClassic
plugin). I'm guessing something usually populates the default options for each plugin and that's not happening.
pages: false,
blog: false,
docs: {
path: './docs',
sidebarPath: require.resolve('./sidebars.js')
},
...
}
For those interested, note that you can debug this stuff in vscode by hovering over the build
script line in package.json then choose Debug Script. then you can hit breakpoints etc.
adding
authorsMapPath: '',
to blog
config section solves part of the problem with docusaurus write-translations
that casues this, but I'm digging further
It broke my heart! This is my first time using it, but this project doesn't work and I can't even start it.
This is a non-retro compatible update in Jiti v1.21.1, the tool we use to load plugin module graphs.
https://github.com/unjs/jiti/issues/237
Reverting to Jiti v1.21.0 fixes the problem.
Make sure you don't have the problematic version of Jiti in your lock file.
yarn users can use the following:
"resolutions": {
"jiti": "1.21.0"
},
I'd encourage you to downgrade Jiti rather than try to find another workaround because other things might be broken as well.
Note: if you don't have a lockfile, you should really have one to prevent such issues from randomly appearing in your project. This kind of problem should only happen when you upgrade site dependencies.
Hey this is the issue: https://github.com/unjs/jiti/releases/tag/v1.21.1
I guess there were some breaking changes
edit: damn, 8 minutes too late
@slorber you don't provide a lock file, thus the dependencies will be resolved according to your package's package.json
file, where the version for jiti
is ^
This is a non-retro compatible update in Jiti v1.21.1, the tool we use to load plugin module graphs.
Reverting to Jiti v1.21.0 fixes the problem.
Make sure you don't have the problematic version of Jiti in your lock file.
yarn users can use the following:
"resolutions": { "jiti": "1.21.0" },
I'd encourage you to downgrade Jiti rather than try to find another workaround because other things might be broken as well.
Note: if you don't have a lockfile, you should really have one to prevent such issues from randomly appearing in your project. This kind of problem should only happen when you upgrade site dependencies.
The template doesn't have a lock file so any new site is getting the incompatible version. We probably need to adjust the version constraint for this?
For npm
users you can simply add the constraint in your own package.json
file directly as "jiti": "1.21.0"
. Yarn users should use the resolutions fix advised by @slorber
Hi all. jiti@1.21.2 was released as a hotfix for this issue. You can remove the resolution and upgrade your lock file to receive the fix 🤞🏼
Confirming - I no longer see the issue on fresh installs or existing installs without the constraint or explicit dependency.
Thanks @pi0 !
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
error while running dev server
Reproducible demo
No response
Steps to reproduce
Expected behavior
dev server running
Actual behavior
erroring
TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined
Your environment
Self-service