Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview on VScode doesn't work #731

Closed
QianC95 opened this issue Feb 15, 2024 · 14 comments
Closed

Preview on VScode doesn't work #731

QianC95 opened this issue Feb 15, 2024 · 14 comments
Labels
ide:vscode Issues that relate to the Esbonio vscode extension

Comments

@QianC95
Copy link

QianC95 commented Feb 15, 2024

It keeps loading without any error notifications. It's Esbonio v0.92.1 (pre-release).

Appreciate it if anyone can help me to solve this problem.

@alcarney
Copy link
Member

If this is your first time running the extension, chances are the server hasn't yet generated a preview it can show you - have you tried editing and saving a file in your project? You might have to close and re-open the preview once that first build has finished.

It might also be worth setting esbonio.server.logLevel to debug and checking the Esbonio tab in the Output panel to see what is included there.

@alcarney alcarney added the ide:vscode Issues that relate to the Esbonio vscode extension label Feb 15, 2024
@QianC95
Copy link
Author

QianC95 commented Feb 16, 2024

If this is your first time running the extension, chances are the server hasn't yet generated a preview it can show you - have you tried editing and saving a file in your project? You might have to close and re-open the preview once that first build has finished.

It might also be worth setting esbonio.server.logLevel to debug and checking the Esbonio tab in the Output panel to see what is included there.

Thanks for your reply! My project is not empty and I can make html to see the result. I tried to close and re-open it, but it didn't work. I also tried your second suggestion. Here's the output. I have no clue how to solve it. Could you please interpret it?

2024-02-15 21:08:08.065 [error] Canceled: Canceled
at LanguageClient2.handleFailedRequest (c:\Users\cq.vscode\extensions\swyddfa.esbonio-0.92.1\dist\node\extension.js:16203:23)
at c:\Users\cq.vscode\extensions\swyddfa.esbonio-0.92.1\dist\node\extension.js:13279:27
at async s.h (c:\Users\cq\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:150:175235)
at async PreviewManager.previewEditor (c:\Users\cq.vscode\extensions\swyddfa.esbonio-0.92.1\dist\node\extension.js:18839:18)
at async PreviewManager.openPreviewToSide (c:\Users\cq.vscode\extensions\swyddfa.esbonio-0.92.1\dist\node\extension.js:18800:12) esbonio.server.previewFile {"value":"swyddfa.esbonio","_lower":"swyddfa.esbonio"}

@lextm
Copy link
Contributor

lextm commented Feb 17, 2024

You might want to share more about your folder and how you configured it.

I left some typical setup options in #733 and I am certain some of them work very well with Esbonio v0.92.1. The clearer people know your specific setup, the easier they can guide you through.

Also note that some transient errors can be resolved if you click View | Command Palette ... menu item and choose Developer: Reload Window to reload the VS Code window, not just "close and re-open it".

@alcarney
Copy link
Member

My project is not empty and I can make html to see the result

One thing to keep in mind is that the server by default will not see the build output of make html. Instead, it uses a separate cache folder so that it does not interfere with your project.

If you want it to use the same folder as make html, you would have to set the esbonio.sphinx.buildCommand option. The exact command will depend on your project and how your Makefile is configured, but it should be something along the lines of ["sphinx-build", "-M", "html", "docs", "docs/_build"]

Here's the output. I have no clue how to solve it. Could you please interpret it?

Unfortunately, that's not the log output I expected to see... you might have found a different Output channel.
Here is a screenshot of the kind of output we're looking for, note that Esbonio is selected in the dropdown on the top-right

image

@oxFilla
Copy link

oxFilla commented Apr 16, 2024

That's how it worked for me:

pip install -U doc8
pip install -U esbonio

Extensions:

  • lextudio.restructuredtext
  • swyddfa.esbonio

Visual Studio Code Setting:
"esbonio.server.pythonPath": "python.exe"

python must be in the path of the system environment. To check that: Open cmd and enter python. This should find the command.

@QianC95
Copy link
Author

QianC95 commented Jun 17, 2024

I fixed it by setting up a virtual environment. The python path in the "settings.json" is always wrong so I manually changed it to my virtual environment. Everything is good now. Thanks for all your help!

@marcel-22
Copy link

I have a similar issue where the Preview function doesn't work. I am running the Esbonio pre-release version 0.94.2.

The setup is as follows:

  • The global Python environment is not accessible by default; only the Windows py launcher. This is to ensure all Python commands must operate on an activated virtual environment.
  • A virtual environment is created in the project's .venv folder.

I get the following 2 error messages:

  1. The Esbonio output window gives the following message:
    [client] Error in 'sphinx/clientCreated' notification handler: TypeError: Cannot read properties of undefined (reading 'join')
  2. The Esbonio extension gives the following the message: "ValueError: No python environment configured".

I have tried changing Esbonio and Python extensions settings, but so far nothing worked. The configuration mentioned by @oxFilla did not work either.

@alcarney
Copy link
Member

I get the following 2 error messages:

  1. I think is just a side effect from 2.
  2. Sounds like the extension is not passing your .venv onto the server...

I have tried changing Esbonio and Python extensions settings,

I assume then, you've tried using the Python extension's Python: Select Interpreter command to make the .venv your active environment?

Have you also tried setting the esbonio.sphinx.pythonCommand to something like ["C:\\Users\\...\\.venv\\Scripts\\python.exe"] (wherever your .venv python.exe is). That should override the integration with the Python extension and Esbonio fallback to using whatever you give it.

If none of that works, if you can share some of the logs related to workspace/configuration requests, esbonio.Configuration or the esbonio.SphinxManager that will hopefully give an idea of what's happening.

@marcel-22
Copy link

marcel-22 commented Jun 25, 2024

I assume then, you've tried using the Python extension's Python: Select Interpreter command to make the .venv your active environment?

Yes, that's correct.

Have you also tried setting the esbonio.sphinx.pythonCommand ...

Yes, I have tried both esbonio.server.pythonPath as well as esbonio.sphinx.pythonCommand, but I am not sure what the differences are....

I now have set the following settings. I also tested with absolute paths.

    "esbonio.server.pythonPath": ".venv\\Scripts\\python.exe",
    "esbonio.sphinx.pythonCommand": [
        ".venv\\Scripts\\python.exe"
    ],

And the Esbonio log is:

[client] Unable to resolve command lsp-devtools: Error: Command failed: command -v lsp-devtools
'command' is not recognized as an internal or external command,
operable program or batch file.

[client] Using user configured Python: .venv\Scripts\python.exe
[client] Server start command: .venv\Scripts\python.exe -S -m esbonio.server
[client] LanguageClientOptions: {
  "documentSelector": [
    {
      "scheme": "file",
      "language": "restructuredtext"
    },
    {
      "scheme": "file",
      "language": "markdown"
    }
  ],
  "outputChannel": {
    "name": "Esbonio"
  },
  "connectionOptions": {
    "maxRestartCount": 0
  },
  "middleware": {
    "workspace": {},
    "window": {}
  }
}
[client] Starting Language Server
[esbonio] Loaded extension 'esbonio.server.features.log'
[esbonio] Loaded extension 'esbonio.server.features.project_manager'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_manager'
[esbonio] Loaded extension 'esbonio.server.features.preview_manager'
[esbonio] Loaded extension 'esbonio.server.features.directives'
[esbonio] Loaded extension 'esbonio.server.features.roles'
[esbonio] Loaded extension 'esbonio.server.features.rst.directives'
[esbonio] Loaded extension 'esbonio.server.features.rst.roles'
[esbonio] Loaded extension 'esbonio.server.features.myst.directives'
[esbonio] Loaded extension 'esbonio.server.features.myst.roles'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.diagnostics'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.symbols'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.directives'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.roles'
[esbonio] Initialising esbonio v1.0.0b5, using Python v3.11.1 on Windows-10
[esbonio] Language client: Visual Studio Code 1.90.2
[esbonio.Configuration] Scanning workspace folder: 'd:\Projecten\Platform\sigma.git'
[esbonio.Configuration] workspace/configuration: {
  "items": [
    {
      "section": "esbonio"
    },
    {
      "scopeUri": "file:///d%3A/Projecten/Platform/sigma.git",
      "section": "esbonio"
    }
  ]
}
[esbonio.Configuration] Workspace 'None' configuration: {
  "server": {
    "enabled": true,
    "documentSelector": [],
    "startupModule": "esbonio.server",
    "excludedModules": [],
    "includedModules": [],
    "pythonPath": ".venv\\Scripts\\python.exe",
    "completion": {
      "preferredInsertBehavior": "replace"
    },
    "enableDevTools": false,
    "debug": false,
    "showDeprecationWarnings": false,
    "installBehavior": "nothing"
  },
  "sphinx": {
    "buildCommand": [
      "--tag preview"
    ],
    "pythonCommand": [
      ".venv\\Scripts\\python.exe"
    ],
    "enableDevTools": false,
    "pythonPath": [],
    "forceFullBuild": true,
    "tags": [
      "preview"
    ]
  },
  "preview": {
    "showLineMarkers": false
  },
  "logging": {
    "level": "debug",
    "stderr": true,
    "window": false,
    "config": {}
  },
  "trace": {
    "server": "off"
  }
}
[esbonio.Configuration] Workspace 'file:///d%3A/Projecten/Platform/sigma.git' configuration: {
  "server": {
    "enabled": true,
    "documentSelector": [],
    "startupModule": "esbonio.server",
    "excludedModules": [],
    "includedModules": [],
    "pythonPath": ".venv\\Scripts\\python.exe",
    "completion": {
      "preferredInsertBehavior": "replace"
    },
    "enableDevTools": false,
    "debug": false,
    "showDeprecationWarnings": false,
    "installBehavior": "nothing"
  },
  "sphinx": {
    "buildCommand": [
      "--tag preview"
    ],
    "pythonCommand": [
      ".venv\\Scripts\\python.exe"
    ],
    "enableDevTools": false,
    "pythonPath": [],
    "forceFullBuild": true,
    "tags": [
      "preview"
    ]
  },
  "preview": {
    "showLineMarkers": false
  },
  "logging": {
    "level": "debug",
    "stderr": true,
    "window": false,
    "config": {}
  },
  "trace": {
    "server": "off"
  }
}
[esbonio] Registered 'workspace/didChangeConfiguration' handler
[esbonio] Registered 'workspace/didChangeWatchedFiles' handler
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "config": {},
  "stderr": true,
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False), previous=None)
[esbonio] Scheduled task: <Task pending name='Task-8' coro=<PreviewManager.show_preview_uri() running at c:\Users\...\.vscode\extensions\swyddfa.esbonio-0.94.2\bundled\libs\esbonio\server\features\preview_manager\__init__.py:183>>
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "config": {},
  "stderr": true,
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "config": {},
  "stderr": true,
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "config": {},
  "stderr": true,
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "config": {},
  "stderr": true,
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "config": {},
  "stderr": true,
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio] Task finished: <Task finished name='Task-8' coro=<PreviewManager.show_preview_uri() done, defined at c:\Users\...\.vscode\extensions\swyddfa.esbonio-0.94.2\bundled\libs\esbonio\server\features\preview_manager\__init__.py:183> result=None>
[esbonio.SphinxManager] No client found, creating new subscription
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "config": {},
  "stderr": true,
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: 'file:///c%3A/Marcel/Projecten/Platform/sigma.git'
[esbonio.Configuration] Resolved config: {}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, python_command=[], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, python_command=[], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] ConfigChangeEvent(scope='file:///c%3A/Marcel/Projecten/Platform/sigma.git', value=SphinxConfig(enable_dev_tools=False, python_command=[], build_command=[], env_passthrough=[], cwd='', python_path=[]), previous=None)
[esbonio.SphinxManager] Trying path: d:\Projecten\Platform\sigma.git\docs\design\subsystem1
[esbonio.SphinxManager] Trying path: d:\Projecten\Platform\sigma.git\docs\design
[esbonio.SphinxManager] Trying path: d:\Projecten\Platform\sigma.git\docs
[esbonio.SphinxManager] Cwd: d:\Projecten\Platform\sigma.git
[esbonio.SphinxManager] Build command: ['sphinx-build', '-M', 'dirhtml', 'd:\\Projecten\\Platform\\sigma.git\\docs', 'C:\\Users\\...\\AppData\\Local\\swyddfa\\esbonio\\Cache\\4f10c368ded1204bc5687f0827e3f574']
[esbonio.SphinxManager] Client created for scope file:///c%3A/Marcel/Projecten/Platform/sigma.git
[esbonio.SphinxManager] SphinxClient[1da97a9a-1632-4ac4-b8b1-f28c3e65cdc9]: None -> ClientState.Starting
[client] sphinx/clientCreated: {
  "id": "1da97a9a-1632-4ac4-b8b1-f28c3e65cdc9",
  "scope": "file:///c%3A/Marcel/Projecten/Platform/sigma.git",
  "config": {
    "buildCommand": [
      "sphinx-build",
      "-M",
      "dirhtml",
      "d:\\Projecten\\Platform\\sigma.git\\docs",
      "C:\\Users\\...\\AppData\\Local\\swyddfa\\esbonio\\Cache\\4f10c368ded1204bc5687f0827e3f574"
    ],
    "cwd": "d:\\Projecten\\Platform\\sigma.git",
    "pythonPath": [
      "c:\\Users\\...\\.vscode\\extensions\\swyddfa.esbonio-0.94.2\\bundled\\libs\\esbonio"
    ]
  }
}
[client] Error in 'sphinx/clientCreated' notification handler: TypeError: Cannot read properties of undefined (reading 'join')
[esbonio.SphinxManager] Unable to start SphinxClient: No python environment configured
Traceback (most recent call last):
  File "c:\Users\...\.vscode\extensions\swyddfa.esbonio-0.94.2\bundled\libs\esbonio\server\features\sphinx_manager\client_subprocess.py", line 199, in start
    command = get_start_command(self.config, self.logger)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\...\.vscode\extensions\swyddfa.esbonio-0.94.2\bundled\libs\esbonio\server\features\sphinx_manager\client_subprocess.py", line 351, in get_start_command
    raise ValueError("No python environment configured")
ValueError: No python environment configured
[esbonio.SphinxManager] SphinxClient[1da97a9a-1632-4ac4-b8b1-f28c3e65cdc9]: ClientState.Starting -> ClientState.Errored
[client] sphinx/clientErrored: {
  "id": "1da97a9a-1632-4ac4-b8b1-f28c3e65cdc9",
  "error": "ValueError: No python environment configured",
  "detail": "Traceback (most recent call last):\n  File \"c:\\Users\\...\\.vscode\\extensions\\swyddfa.esbonio-0.94.2\\bundled\\libs\\esbonio\\server\\features\\sphinx_manager\\client_subprocess.py\", line 199, in start\n    command = get_start_command(self.config, self.logger)\n              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"c:\\Users\\...\\.vscode\\extensions\\swyddfa.esbonio-0.94.2\\bundled\\libs\\esbonio\\server\\features\\sphinx_manager\\client_subprocess.py\", line 351, in get_start_command\n    raise ValueError(\"No python environment configured\")\nValueError: No python environment configured\n"
}
[esbonio.ProjectManager] No applicable project for uri: file:///d%3A/Projecten/Platform/sigma.git/docs/design/subsystem1/software.rst
[esbonio.ProjectManager] No applicable project for uri: file:///d%3A/Projecten/Platform/sigma.git/docs/design/subsystem1/software.rst

@marcel-22
Copy link

My project is on a subst D-drive, which actually points to a location on the C-drive. To make sure that doesn't screw things up, I also tested with a project on the regular C-drive. But then I get a completely different error: JsonRpcInternalError. I have created a new issue #843 for that. BTW, the current release version of Esbonio works fine with subst drives, so I don't expect this would be an issue.

@alcarney
Copy link
Member

Unfortunately, in this case I think the subst drive is causing the issue and that you're hitting a variant of #813

The server is being given the .venv you've configured and told that it applies to you project on the D-drive.

[esbonio.Configuration] Workspace 'file:///d%3A/Projecten/Platform/sigma.git' configuration: {
  "sphinx": {
    "pythonCommand": [
      ".venv\\Scripts\\python.exe"
    ],
}

However, when it gets around to spinning up the Sphinx process the server has done the equivalent of calling pathlib.Path.resolve() on the project, revealing that it in fact lives on the C-drive - so when it looks up the project's configuration it does not find it :/

[esbonio.Configuration] ConfigChangeEvent(
  scope='file:///c%3A/Marcel/Projecten/Platform/sigma.git', 
  value=SphinxConfig(
    python_command=[]
  )

If it wasn't for #843, I would have suggested running the project from the C-drive as a work around for now.

Side note: I've not come across subst drives before, what would you say the main use case is? Is it "just" a handy shortcut to a location on your drive, or is there more to it?

@marcel-22
Copy link

Side note: I've not come across subst drives before, what would you say the main use case is? Is it "just" a handy shortcut to a location on your drive, or is there more to it?

Hm, yes, normally I'm not using subst drives; It provides a "handy" shortcut to some other folder. You are correct, a subst drive in most ways indeed acts like a network drive.
The main reason that I am using a subst drive at work, is to keep my favorite data organization: Windows on C-drive, Data on D-drive. This is the setup I always use at home, and the one I have been using at all my previous employers. To prevent changes to the disk layout, and to keep IT happy, I currently use a subst drive at work. Maybe I should create a real partition after all...

@alcarney
Copy link
Member

I see, thank you for elaborating! :)

@alcarney
Copy link
Member

Closing as I think all issues here have either been resolved or are covered in other threads, let me know if that's not the case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide:vscode Issues that relate to the Esbonio vscode extension
Projects
None yet
Development

No branches or pull requests

5 participants