dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.78k stars 260 forks source link

"common_server_1.DConfig.getRaw is not a function" error shows when publishing using dendron-cli #3990

Open walkerwzy opened 4 months ago

walkerwzy commented 4 months ago

Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

Describe the bug

when follow the document "publish quick start", the first step dendron publish init, it show the error, detail message:

(node:17709) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
dendron publish <cmd>

commands for publishing notes

位置:
  cmd  a command to run
                      [字符串] [必需] [可选值: "init", "build", "dev", "export"]

选项:
  --version    显示版本号                                                 [布尔]
  --help       显示帮助信息                                               [布尔]
  --wsRoot     location of workspace
  --vault      name of vault
  --quiet      don't print output to stdout
  --dest       override where nextjs-template is located                [字符串]
  --attach     use existing dendron engine instead of spawning a new one  [布尔]
  --noBuild    skip building notes                        [布尔] [默认值: false]
  --overrides  override existing siteConfig properties                  [字符串]
  --target     export to specific destination                 [可选值: "github"]
  --yes        automatically say yes to all prompts                       [布尔]
  --sitemap    generates a sitemap: https://en.wikipedia.org/wiki/Site_map[布尔]

TypeError: common_server_1.DConfig.getRaw is not a function
    at PublishCLICommand.validateConfig (/Users/walker/.nvm/versions/node/v22.5.1/lib/node_modules/@dendronhq/dendron-cli/lib/src/commands/base.js:123:55)
    at CLICommand.eval [as handler] (/Users/walker/.nvm/versions/node/v22.5.1/lib/node_modules/@dendronhq/dendron-cli/lib/src/commands/base.js:49:28)
    at Object.runCommand (/Users/walker/.nvm/versions/node/v22.5.1/lib/node_modules/@dendronhq/dendron-cli/node_modules/yargs/build/lib/command.js:196:48)
    at Object.parseArgs [as _parseArgs] (/Users/walker/.nvm/versions/node/v22.5.1/lib/node_modules/@dendronhq/dendron-cli/node_modules/yargs/build/lib/yargs.js:1043:55)
    at Object.get [as argv] (/Users/walker/.nvm/versions/node/v22.5.1/lib/node_modules/@dendronhq/dendron-cli/node_modules/yargs/build/lib/yargs.js:986:25)
    at Object.<anonymous> (/Users/walker/.nvm/versions/node/v22.5.1/lib/node_modules/@dendronhq/dendron-cli/lib/bin/dendron-cli.js:42:52)
    at Module._compile (node:internal/modules/cjs/loader:1504:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1588:10)
    at Module.load (node:internal/modules/cjs/loader:1282:32)
    at Module._load (node:internal/modules/cjs/loader:1098:12)

To Reproduce

just run dendron publish init

Desktop (please complete the following information)

Additional context

Add any other context about the problem here.

Dendron Log file

Please attach the output of > Dendron:Dev: Open Logs here

LiangWei88 commented 2 months ago

This is an issue with the latest version, there was a breaking change, and the DConfig module has been deprecated. I am using the template provided on the official website. The version of dendron-cli being used there is 0.106.0. I installed this version under the current project and then called it by setting a script in package.json like this: "dev": "dendron publish dev", which allows you to call the local version in the current folder, bypassing the globally installed version. You can try this. Of course, you can also check the version numbers mentioned by other users to see which newer version is available.

BravishkaSkytano commented 1 month ago

This error is also happening on my end. I'm running Windows 11, and I also tried with WSL.

BravishkaSkytano commented 1 month ago

The version of dendron-cli being used there is 0.106.0. I installed this version under the current project and then called it by setting a script in package.json like this: "dev": "dendron publish dev", which allows you to call the local version in the current folder, bypassing the globally installed version.

You can also install that version by running npm install -g @dendronhq/dendron-cli@0.106.0

I did that and it seems to be working, for now.