You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error when using symlinked docs folder: Module parse failed: Assigning to rvalue #3272
bugAn error in the Docusaurus core causing instability or issues with its executionstatus: needs more informationThere is not enough information to take action on the issue.
Failed when running npm run start. Lots of errors. (only showing partial log)
c:\Users\karl\firkin-www>npm run start
> [email protected] start c:\Users\karl\firkin-www
> docusaurus start
Starting the development server...
× Client
Compiled with some errors in 3.36s
i 「wds」: Project is running at http://localhost:3000/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from c:\Users\karl\firkin-www
i 「wds」: 404s will fallback to /index.html
c:/users/karlp/firkin-www/docs/doc1.md 1:2
Module parse failed: Assigning to rvalue (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> ---
| id: doc1
| title: Style Guide
@ c:/users/karlp/firkin-www/.docusaurus/registry.js 1:3494-3536 1:3394-3471
@ c:/users/karlp/firkin-www/node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js
@ c:/users/karlp/firkin-www/.docusaurus/routes.js
@ c:/users/karlp/firkin-www/node_modules/@docusaurus/core/lib/client/clientEntry.js
@ multi c:/users/karlp/firkin-www/node_modules/react-dev-utils/webpackHotDevClient.js c:/users/karlp/firkin-www/node_modules/@docusaurus/core/lib/client/clientEntry.jsc:/users/karlp/firkin-www/docs/doc2.md 1:2
Module parse failed: Assigning to rvalue (1:2)
I just tried this on another machine (also Windows) and it worked fine. So you may be right - it might just be my env.
To answer your questions, though - I didn't modify anything in the generated project. And I was in the correct directory (the initial command using my-website was wrong).
I`m trying to use version feature with docusaurus v2 (2.0.0-alpha.61) and get the same error:
× Client Compiled with some errors in 150.24ms./versioned_docs/version-1.1.0/doc1.md 1:2Module parse failed: Assigning to rvalue (1:2)You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> ---| id: doc1| title: Style Guide @ ./.docusaurus/registry.js 1:4301-4368 1:4145-4253 @ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js @ ./.docusaurus/routes.js @ ./node_modules/@docusaurus/core/lib/client/clientEntry.js @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js./versioned_docs/version-1.1.0/doc2.md 1:2Module parse failed: Assigning to rvalue (1:2)You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> ---| id: doc2| title: Document Number 2 @ ./.docusaurus/registry.js 1:4746-4813 1:4590-4698 @ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js @ ./.docusaurus/routes.js @ ./node_modules/@docusaurus/core/lib/client/clientEntry.js @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js./versioned_docs/version-1.1.0/doc3.md 1:2Module parse failed: Assigning to rvalue (1:2)You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> ---| id: doc3| title: This is Document Number 3 @ ./.docusaurus/registry.js 1:5373-5440 1:5218-5325 @ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js @ ./.docusaurus/routes.js @ ./node_modules/@docusaurus/core/lib/client/clientEntry.js @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js./versioned_docs/version-1.1.0/mdx.md 1:2Module parse failed: Assigning to rvalue (1:2)You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> ---| id: mdx| title: Powered by MDX @ ./.docusaurus/registry.js 1:5809-5875 1:5657-5762 @ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js @ ./.docusaurus/routes.js @ ./node_modules/@docusaurus/core/lib/client/clientEntry.js @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js
I'm running into the same issue, when trying to use files that a symlink in from another directory. Are you aware of any issues with symlinks?
My errors look like this
../idl/docs/md/all.mdx 1:2
Module parse failed: Assigning to rvalue (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> ---
| id: all.proto
| title: All
@ ./.docusaurus/registry.js 1:4050-4105 1:3886-4014
@ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js
@ ./.docusaurus/routes.js
@ ./node_modules/@docusaurus/core/lib/client/clientEntry.js
@ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js../idl/docs/md/bom.mdx 1:2
Module parse failed: Assigning to rvalue (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> ---
| id: bom.proto
| title: BOM
@ ./.docusaurus/registry.js 1:4343-4398 1:4177-4307
@ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js
@ ./.docusaurus/routes.js
@ ./node_modules/@docusaurus/core/lib/client/clientEntry.js
@ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js../idl/docs/md/bom_service.mdx 1:2
So I will have two repos, main project eg. xyz and second repo xyz-github.io which will generate documentation with docusaurus and deploy to github.io. xyz-github.io will have symlinked docs folder to xyz/docs folder.
That's very much like my use case as well, just to say.
Unfortunately, I have to revert the change I made (#5164).
There is a bug in Webpack 5 caching and using resolve.symlinks: false lead to deploying a Docusaurus site with stale cache entries.
If you implement a Docusaurus plugin as part of a monorepo and change some UI code, your new deployment (dev + prod) may not see your changes. Not many sites will be affected by this in practice (theme components should be fine fine), but it's particularly painful for ourselves: Docusaurus PR Netlify deploy previews show stale UI components.
If you decide to stick to using webpack.resolve.symlinks = false in your site for symlinks reasons, and have some monorepo UI lib symlinked, I recommend to run docusaurus clear to be free of nasty side-effects.
Also, I'm not sure using symlinks: false is a good solution, and webpack contributors do not seem to agree it's a good idea to use false either.
I'd like to recommend another workaround: instead of using symlinks: false, you can try to resolve the symlink to the real location, directly in your config:
Please let me know if this workaround works for your site.
We'll only try to apply symlinks: false again if some come up with a case where it does not work and we can't find any other solution (repros / linked repos appreciated)
changed the title [-]Symlink + Couldn't start classic template: Module parse failed: Assigning to rvalue[/-][+]Error when using symlinked docs folder: Module parse failed: Assigning to rvalue[/+]on Jul 21, 2021
Can confirm on this. With { symlink: false} HMR does not work. Tried using the { followsymlinks: true} option in devServer conf, but it does not work as intended. The app recompiles on changes but the browser does not refreshes the content.
FYI - I am not using a docusaurus plugin. Just changing webpack.dev.config.js
@leograba the canary now allows putting mdx docs anywhere (#5299) so you shouldn't need symlinks anymore: just import the mdx files where you want to use them.
However keep in mind the link resolution in those partials is "simpler", it doesn't resolve relative md file paths but only regular relative/abslute links. Also there's a TOC limitation (#3915)
@slorber thanks! I have tested it with the canary release 0.0.0-3900 and it worked well.
About the link resolution, I have previously noticed that that the "simpler" link resolution also affects referring to a different doc in a multi-docs setup, so I've been already using relative links. I'll keep in mind the limitations of relative links instead of relative file paths.
Yes, only the docs plugin resolve relative md file paths currently and it's limited to the scope of a single instance. We need some additional infrastructure so that plugins can expose to each others a filePath => absolute url mapping. But anyway if 2 instances have different version schemes you'd rather avoid such links because it won't play well with versioning, as the versined docs would be in a totally different folders. In such case we'll probably need to support something like [SomeLink](@site/docs/myDoc.md) to make those links easier to version.
The Webpack 5 caching bug should be resolved in webpack/webpack#14019
Using symlinks: false should be safe again in webpack 5.51.0
Let me know how it works for you.
This doesn't work with pnpm. If I set resolve.symlinks: false, then webpack is no longer able to build the website if dependencies were installed with deno or pnpm.
bugAn error in the Docusaurus core causing instability or issues with its executionstatus: needs more informationThere is not enough information to take action on the issue.
Activity
slorber commentedon Aug 14, 2020
I have no idea what's going on but it works for me.
Can someone reproduce this consistently?
Maybe it's specific to your env (like Windows only bug? I don't have Windows).
Can you try with yarn instead of npm? (both works for me)
Have you modified anything at all of the generated project?
Are you sure you are in the correct directory? I see you created
my-website, yet the logs show you are infirkin-wwwkewp commentedon Aug 14, 2020
Hey @slorber
I just tried this on another machine (also Windows) and it worked fine. So you may be right - it might just be my env.
To answer your questions, though - I didn't modify anything in the generated project. And I was in the correct directory (the initial command using
my-websitewas wrong).slorber commentedon Aug 14, 2020
Ok great to know.
Not sure what I can do about this issue, so I'm closing, but let's reopen it if other users are affected and we get more info.
limkinZero commentedon Aug 21, 2020
Hi @slorber
I`m trying to use version feature with docusaurus v2 (2.0.0-alpha.61) and get the same error:
slorber commentedon Aug 21, 2020
Hi,
Can you give us more infos on your env?
Are you both on Windows?
Wonder if you use a fs path with spaces in it or something? That can lead to issues sometimes.
CyborgMaster commentedon Sep 6, 2020
I'm running into the same issue, when trying to use files that a symlink in from another directory. Are you aware of any issues with symlinks?
My errors look like this
20 remaining items
felipecrs commentedon Jul 8, 2021
That's very much like my use case as well, just to say.
slorber commentedon Jul 8, 2021
great, we'll figure out later if using symlinks inside the docs root folder is necessary.
If you have this need please explain your usecase.
I've added a new docs plugin instance using a root symlink so that we keep this behavior working over time. CI builds fine on linux/windows: https://deploy-preview-5126--docusaurus-2.netlify.app/docs-tests
slorber commentedon Jul 13, 2021
Unfortunately, I have to revert the change I made (#5164).
There is a bug in Webpack 5 caching and using
resolve.symlinks: falselead to deploying a Docusaurus site with stale cache entries.If you implement a Docusaurus plugin as part of a monorepo and change some UI code, your new deployment (dev + prod) may not see your changes. Not many sites will be affected by this in practice (theme components should be fine fine), but it's particularly painful for ourselves: Docusaurus PR Netlify deploy previews show stale UI components.
If you decide to stick to using
webpack.resolve.symlinks = falsein your site for symlinks reasons, and have some monorepo UI lib symlinked, I recommend to rundocusaurus clearto be free of nasty side-effects.Also, I'm not sure using
symlinks: falseis a good solution, and webpack contributors do not seem to agree it's a good idea to usefalseeither.I'd like to recommend another workaround: instead of using
symlinks: false, you can try to resolve the symlink to the real location, directly in your config:Please let me know if this workaround works for your site.
We'll only try to apply
symlinks: falseagain if some come up with a case where it does not work and we can't find any other solution (repros / linked repos appreciated)[-]Couldn't start classic template: Module parse failed: Assigning to rvalue[/-][+]Symlink + Couldn't start classic template: Module parse failed: Assigning to rvalue[/+][-]Symlink + Couldn't start classic template: Module parse failed: Assigning to rvalue[/-][+]Error when using symlinked docs folder: Module parse failed: Assigning to rvalue[/+]nitinkatyal1314 commentedon Jul 27, 2021
Can confirm on this. With
{ symlink: false}HMR does not work. Tried using the{ followsymlinks: true}option indevServerconf, but it does not work as intended. The app recompiles on changes but the browser does not refreshes the content.FYI - I am not using a docusaurus plugin. Just changing
webpack.dev.config.jsleograba commentedon Aug 9, 2021
If one has a docs multi-instance and wants to share a directory with partials between two docs instances, would the symlink approach work?
slorber commentedon Aug 10, 2021
@leograba the canary now allows putting mdx docs anywhere (#5299) so you shouldn't need symlinks anymore: just import the mdx files where you want to use them.
However keep in mind the link resolution in those partials is "simpler", it doesn't resolve relative md file paths but only regular relative/abslute links. Also there's a TOC limitation (#3915)
leograba commentedon Aug 10, 2021
@slorber thanks! I have tested it with the canary release
0.0.0-3900and it worked well.About the link resolution, I have previously noticed that that the "simpler" link resolution also affects referring to a different doc in a multi-docs setup, so I've been already using relative links. I'll keep in mind the limitations of relative links instead of relative file paths.
About the TOC, keeping an eye on (#3915) :)
slorber commentedon Aug 10, 2021
Yes, only the docs plugin resolve relative md file paths currently and it's limited to the scope of a single instance. We need some additional infrastructure so that plugins can expose to each others a
filePath => absolute urlmapping. But anyway if 2 instances have different version schemes you'd rather avoid such links because it won't play well with versioning, as the versined docs would be in a totally different folders. In such case we'll probably need to support something like[SomeLink](@site/docs/myDoc.md)to make those links easier to version.slorber commentedon Aug 19, 2021
The Webpack 5 caching bug should be resolved in webpack/webpack#14019
Using
symlinks: falseshould be safe again in webpack 5.51.0Let me know how it works for you.
felipecrs commentedon Apr 3, 2025
This doesn't work with pnpm. If I set
resolve.symlinks: false, then webpack is no longer able to build the website if dependencies were installed with deno or pnpm.Is there any way around it?
This doesn't work for me because my docs path is not a symlink, but some md files inside of it are.
slorber commentedon Apr 4, 2025
As far as I know, we only support symlinking the root docs folder, not individual dirs/files inside it.
felipecrs commentedon Apr 4, 2025
Oh. Ok.
resolve.symlinks: falseworked for me for years at this point, but it became an issue after deciding to switch to PNPM.Is this some feature you can consider supporting (i.e. should I open a separate request), or is it out of consideration?