Tried to run the 'classic' template following the getting started steps https://v2.docusaurus.io/docs/installation
npx @docusaurus/init@next init my-website classic
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 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 in firkin-www
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-website was wrong).
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.
Hi @slorber
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: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
@ ./.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: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: 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: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: 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: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: 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
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.
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
It almost seems that docusaurus isn't finding the files and compiling them from markdown into js files? Or maybe webpack can't handle symlinks? I don't have enough background to really say.
It may have something to do with this https://github.com/webpack/webpack/issues/1643
Yes! @CyborgMaster this is what fixed it for me.
For me, my user folder c:\users\karl is actually a symlink to c:\users\karlp. If I try run npm run start from the symlink folder it fails but it works from the actually one!
I assume what you're thinking is correct - that webpack doesn't understand symbolic links. Somehow some of the files are not being found.
Thanks for reporting this.
Do you think we can do anything about it?
Note we have this resolve.symlinks: true in config (https://webpack.js.org/configuration/resolve/#resolvesymlinks).
By using a local site plugin + configureWebpack you should be able to override any default setting we set, so maybe it's worth checking if you find a final config that works for your usecase?
Not sure how to fix this. I've tried creating a webpack.config.js locally and setting the config you mention, @slorber , but it has no effect. Not sure how to create a local site plugin as you suggest either.
@kewp we don't read any webpack.config.js file.
The doc to create a local plugin is very simple:
https://v2.docusaurus.io/docs/using-plugins#creating-plugins
https://v2.docusaurus.io/docs/lifecycle-apis#configurewebpackconfig-isserver-utils
I think something like that:
module.exports = function(context, options) {
return {
name: "custom-docusaurus-plugin",
configureWebpack(config, isServer, utils) {
return {
resolve: {
symlinks: false
}
};
}
};
};
Hi @slorber . Yup that worked too :)
@slorber, that worked for me too. I added the plugin you provided in your comment and now the symlinked files work.
I'm obviously not understanding something here, but it feels completely backwards to me that in order to get docs that are symlinked in to work we have to set resolve symlinks: false in the webpack config. But hey, it works.
Thanks for you help! This may be super specific to our setup so I don't know if it belongs in the docusaurus docs or not, but it was certainly tricky to figure out.
Also saw this webpack setting and found it confusing, but as far as I understand it, true means webpack will try to "replace" the symlink by its real location, not that it will enable some kind of mode that works with symlinks.
I don't know either why in Docusaurus we have symlinks: true exactly, not sure we'll be able to know now
Another issue with this symlinks error: https://github.com/facebook/docusaurus/issues/3579
Maybe we should consider switching symlinks to false by default. Not sure about the impact of this, so we'd rather be prepared to revert if users report bugs after release