A JavaScript development environment for Emacs https://indium.readthedocs.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1033 lines
27 KiB

\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename Indium.info
@documentencoding UTF-8
@ifinfo
@*Generated by Sphinx 1.8.4.@*
@end ifinfo
@settitle Indium Documentation
@defindex ge
@paragraphindent 0
@exampleindent 4
@finalout
@dircategory Emacs
@direntry
* Indium: (Indium.info). JavaScript development environment for Emacs.
@end direntry
@definfoenclose strong,`,'
@definfoenclose emph,`,'
@c %**end of header
@copying
@quotation
Indium 2.1.4, Oct 22, 2019
Nicolas Petton
Copyright @copyright{} 2018, Nicolas Petton
@end quotation
@end copying
@titlepage
@title Indium Documentation
@insertcopying
@end titlepage
@contents
@c %** start of user preamble
@c %** end of user preamble
@ifnottex
@node Top
@top Indium Documentation
@insertcopying
@end ifnottex
@c %**start of body
@anchor{index doc}@anchor{0}
@c Indium documentation master file, created by
@c sphinx-quickstart on Tue Apr 4 11:48:03 2017.
@c You can adapt this file completely to your liking, but it should at least
@c contain the root `toctree` directive.
Indium is a JavaScript development environment for Emacs@footnote{http://gnu.org/software/emacs}.
Indium is Free Software, licensed under the GPL v3.0. You can follow its
development on GitHub@footnote{https://github.com/NicolasPetton/indium}.
Indium connects to a browser tab or nodejs process and provides several features
for JavaScript development, including:
@itemize *
@item
a REPL (with auto completion) & object inspection;
@item
an inspector, with history and navigation;
@item
a scratch buffer (@code{M-x indium-scratch});
@item
JavaScript evaluation in JS buffers with @code{indium-interaction-mode};
@item
a stepping Debugger, similar to @code{edebug}, or @code{cider}.
@end itemize
This documentation can be read online at @indicateurl{https://indium.readthedocs.io} and in
Info format (within Emacs with @code{(info "Indium")}).
It is also available in Info format and can be consulted from within Emacs with
@code{C-h i m indium RET}.
@menu
* Table of contents::
* Indices and tables::
@detailmenu
--- The Detailed Node Listing ---
Table of contents
* Installation::
* Getting up and running::
* The REPL::
* Interaction in JS buffers::
* The stepping debugger::
* The inspector::
* Troubleshooting::
Installation
* The Indium server::
* Using MELPA::
* Manual installation::
Getting up and running
* Project configuration::
* General configuration::
* Chrome/Chromium configuration options::
* NodeJS configuration options::
* Starting Indium::
* NodeJS requirements::
* Chrome/Chromium requirements::
The REPL
* Starting a REPL::
* Using the REPL::
* Code evaluation & context::
Using the REPL
* Keybindings::
* Reconnecting from the REPL buffer::
Interaction in JS buffers
* Evaluating and inspecting::
* Switching to the REPL buffer::
* Adding and removing breakpoints::
The stepping debugger
* Using sourcemaps::
* Blackboxing scripts::
Using sourcemaps
* Overriding sourcemap paths::
* Setting a different remote root (NodeJS): Setting a different remote root NodeJS.
The inspector
* Using the inspector::
Troubleshooting
* General advice before reporting issues::
* The Indium server doesn’t start::
* Breakpoints are not set (not using sourcemaps): Breakpoints are not set not using sourcemaps.
* Breakpoints and debugging do not work (using sourcemaps): Breakpoints and debugging do not work using sourcemaps.
@end detailmenu
@end menu
@node Table of contents,Indices and tables,Top,Top
@anchor{index indium}@anchor{1}@anchor{index table-of-contents}@anchor{2}
@chapter Table of contents
@menu
* Installation::
* Getting up and running::
* The REPL::
* Interaction in JS buffers::
* The stepping debugger::
* The inspector::
* Troubleshooting::
@end menu
@node Installation,Getting up and running,,Table of contents
@anchor{installation doc}@anchor{3}@anchor{installation installation}@anchor{4}
@section Installation
@cartouche
@quotation Note
If you already have installed @code{Jade}, you should read the
migration-from-jade page first.
@end quotation
@end cartouche
Indium supports @code{Emacs 25.3+}, works with @code{Chrome} (debugging protocol
@code{v1.2}, see @ref{5,,Chrome/Chromium requirements}) and @code{NodeJS}, see
@ref{6,,NodeJS requirements}.
Indium works with @code{js-mode}, @code{js2-mode}, @code{js2-jsx-mode} and
@code{rjsx-mode}. It supports the ECMAScript features of the runtime it connects
to.
Indium is availabe on MELPA@footnote{https://melpa.org}, MELPA Stable@footnote{https://stable.melpa/org}.
@menu
* The Indium server::
* Using MELPA::
* Manual installation::
@end menu
@node The Indium server,Using MELPA,,Installation
@anchor{installation server-installation}@anchor{7}@anchor{installation the-indium-server}@anchor{8}
@subsection The Indium server
Indium needs to communicate with a small server for evaluation and debugging.
Install the server with the following command (prepend @code{sudo} on GNU/Linux):
@example
npm install -g indium
@end example
@node Using MELPA,Manual installation,The Indium server,Installation
@anchor{installation using-melpa}@anchor{9}
@subsection Using MELPA
Unless you are already using MELPA, you will have to setup @code{package.el} to use
MELPA or MELPA Stable repositories. You can follow this documentation@footnote{https://melpa.org/#/getting-started}.
You can install Indium with the following command:
@example
M-x package-install [RET] indium [RET]
@end example
or by adding this bit of Emacs Lisp code to your Emacs initialization file
(@code{.emacs} or @code{init.el}):
@example
(unless (package-installed-p 'indium)
(package-install 'indium))
@end example
If the installation doesn’t work try refreshing the package list:
@example
M-x package-refresh-contents [RET]
@end example
@node Manual installation,,Using MELPA,Installation
@anchor{installation manual-installation}@anchor{a}
@subsection Manual installation
If you want to install Indium manually, make sure to install @code{websocket.el}.
Obtain the code of Indium from the repository@footnote{https://github.com/NicolasPetton/indium}.
Add the following to your Emacs configuration:
@example
;; load Indium from its source code
(add-to-list 'load-path "~/projects/indium")
(require 'indium)
@end example
@node Getting up and running,The REPL,Installation,Table of contents
@anchor{setup doc}@anchor{b}@anchor{setup getting-up-and-running}@anchor{c}@anchor{setup setup}@anchor{d}
@section Getting up and running
@menu
* Project configuration::
* General configuration::
* Chrome/Chromium configuration options::
* NodeJS configuration options::
* Starting Indium::
* NodeJS requirements::
* Chrome/Chromium requirements::
@end menu
@node Project configuration,General configuration,,Getting up and running
@anchor{setup configuration-file}@anchor{e}@anchor{setup project-configuration}@anchor{f}
@subsection Project configuration
Place a @code{.indium.json} file in the root folder of your JavaScript project.
The project file can contain one or many configurations settings for NodeJS (see
@ref{10,,NodeJS configuration options}) and Chrome/Chromium (see
@ref{11,,Chrome/Chromium configuration options}).
Here is a minimalist @code{.indium.json} file.:
@example
@{
"configurations": [
@{
"name": "Web project",
"type": "chrome"
@}
]
@}
@end example
@node General configuration,Chrome/Chromium configuration options,Project configuration,Getting up and running
@anchor{setup general-configuration}@anchor{12}@anchor{setup id1}@anchor{13}
@subsection General configuration
The @code{.indium.json} file can contain as many configurations as needed, and mix
any supported configuration types.
The currently supported @code{type} values are @code{"chrome"} and @code{"node"}.
The root directory of the source files is by default set to the directory where
this @code{.indium.json} file is placed, but it can be overridden with the @code{root}
(or the @code{webRoot} alias) option:
@example
@{
"configurations": [
@{
"type": "chrome",
"root": "src"
@}
]
@}
@end example
Custom sourcemap path overrides can be set with @code{sourceMapPathOverrides}. See
@ref{14,,Using sourcemaps} for more information on sourcemaps and debugging.
@node Chrome/Chromium configuration options,NodeJS configuration options,General configuration,Getting up and running
@anchor{setup chrome-chromium-configuration-options}@anchor{15}@anchor{setup chrome-configuration}@anchor{11}
@subsection Chrome/Chromium configuration options
@*host:
Host on which Chrome is running (defaults to @code{"localhost"}).
@*port:
Port on which Chrome is running (defaults to @code{9222}).
@*url:
Url to open when running @code{indium-launch}.
Example configuration:
@example
@{
"configurations": [
@{
"name": "Web project",
"type": "chrome",
"host": "192.168.22.1",
"url": "http://192.168.22.1/myproject/index.html",
"port": 9222
@}
]
@}
@end example
@node NodeJS configuration options,Starting Indium,Chrome/Chromium configuration options,Getting up and running
@anchor{setup nodejs-configuration}@anchor{10}@anchor{setup nodejs-configuration-options}@anchor{16}
@subsection NodeJS configuration options
@*command:
Nodejs command to start a new process. The @code{--inspect} flag will be
added automatically.
@*inspect-brk:
Whether Indium should break at the first statement (false by
default).
@*host:
Host on which the Node inspector is listening (defaults to @code{"localhost"}).
@*port:
Port on which the Node inspector is listening (defaults to 9229).
Here is an example configuration for debugging Gulp tasks:
@example
@{
"configurations": [
@{
"name": "Gulp",
"type": "node",
"command": "node ./node_modules/gulp/bin/gulp.js",
"inspect-brk": true
@}
]
@}
@end example
When the NodeJS application runs on another computer (or inside a container like
Docker), a custom remote project root path can be set with @code{remoteRoot}. See
@ref{17,,Setting a different remote root (NodeJS)} for more information on script paths and debugging.
@node Starting Indium,NodeJS requirements,NodeJS configuration options,Getting up and running
@anchor{setup id2}@anchor{18}@anchor{setup starting-indium}@anchor{19}
@subsection Starting Indium
Indium can be started in two modes:
@itemize -
@item
Connect: @code{M-x indium-connect} Connect indium to a running runtime from one
of the configurations in the @code{.indium.json} project file.
@item
Launch: @code{M-x indium-launch} Start a JavaScript process (Chrome or NodeJS) as
specified from the configurations in the @code{.indium.json} project file.
@end itemize
@node NodeJS requirements,Chrome/Chromium requirements,Starting Indium,Getting up and running
@anchor{setup id3}@anchor{1a}@anchor{setup nodejs-requirements}@anchor{6}
@subsection NodeJS requirements
Nodejs >= @code{8.x} is required for Indium to work.
If your distribution ships an old version of NodeJS, you can install a more
recent version using nvm@footnote{https://github.com/creationix/nvm}:
@example
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
@end example
Once @code{nvm} is install, you can easily install and use the version of NodeJS
you want:
@example
$ nvm install v8
$ nvm alias default v8
$ node --version
@end example
If you install NodeJS using @code{nvm}, chances are that Emacs won’t have it in its
@code{exec path}. A simple solution is to use the excellent exec-path-from-shell@footnote{https://github.com/purcell/exec-path-from-shell} package.
@node Chrome/Chromium requirements,,NodeJS requirements,Getting up and running
@anchor{setup chrome-chromium-requirements}@anchor{1b}@anchor{setup chrome-requirements}@anchor{5}
@subsection Chrome/Chromium requirements
Chrome/Chromium >= @code{60.0} is required for Indium to properly work (debugging
protocol @code{v1.2}).
When the variable @code{indium-chrome-use-temporary-profile} is non-nil (the
default), @code{M-x indium-launch} will start a new instance of Chrome/Chromium
with the remote debugging port set up.
Otherwise, you can start Chrome/Chromium with the @code{--remote-debugging-port}
flag like the following:
@example
chromium --remote-debugging-port=9222 https://localhost:3000
@end example
If you start Chrome manually, make sure that no instance of Chrome is already
running, otherwise Chrome will simply open a new tab on the existing Chrome
instance, and the @code{remote-debugging-port} will not be set.
@node The REPL,Interaction in JS buffers,Getting up and running,Table of contents
@anchor{repl doc}@anchor{1c}@anchor{repl repl}@anchor{1d}@anchor{repl the-repl}@anchor{1e}
@section The REPL
@menu
* Starting a REPL::
* Using the REPL::
* Code evaluation & context::
@end menu
@node Starting a REPL,Using the REPL,,The REPL
@anchor{repl starting-a-repl}@anchor{1f}
@subsection Starting a REPL
A REPL (Read Eval Print Loop) buffer is automatically open when a new Indium
connection is made (see @ref{d,,Getting up and running}).
@image{repl,,,,png}
The REPL offers the following features:
@itemize *
@item
Auto completion with @code{company-mode}
@item
JS syntax highlighting
@item
Pretty printing and preview of printed values
@item
Access to the object inspector (see @ref{20,,The inspector})
@end itemize
@image{repl2,,,,png}
@node Using the REPL,Code evaluation & context,Starting a REPL,The REPL
@anchor{repl using-the-repl}@anchor{21}
@subsection Using the REPL
@menu
* Keybindings::
* Reconnecting from the REPL buffer::
@end menu
@node Keybindings,Reconnecting from the REPL buffer,,Using the REPL
@anchor{repl keybindings}@anchor{22}
@subsubsection Keybindings
Here is the list of available keybindings in a REPL buffer:
@multitable {xxxxxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
@headitem
Keybinding
@tab
Description
@item
@code{RET}
@tab
Evalute the current input. When the point is on a printed object, inspect the object.
@item
@code{C-RET}
@tab
Insert a newline.
@item
@code{C-c M-i}
@tab
Evalute the current input and open an inspector on the result.
@item
@code{C-c C-o}
@tab
Clear the output.
@item
@code{C-c C-q}
@tab
Kill the REPL buffer and close the current connection.
@item
@code{M-n}
@tab
Insert the previous input in the history.
@item
@code{M-p}
@tab
Instert the next input in the history.
@end multitable
@node Reconnecting from the REPL buffer,,Keybindings,Using the REPL
@anchor{repl reconnecting-from-the-repl-buffer}@anchor{23}
@subsubsection Reconnecting from the REPL buffer
When a connection is closed (most probably because other devtools were open on
the same runtime), the REPL will display two buttons, one to try to reopen the
connection, and another one to kill Emacs buffers using this connection (the
REPL buffer, inspectors & debuggers).
@node Code evaluation & context,,Using the REPL,The REPL
@anchor{repl code-evaluation-context}@anchor{24}
@subsection Code evaluation & context
When evaluating code in the REPL, Indium will always run the code on the current
execution context.
This means that while debugging, code execution will happen in the context of
the current stack frame, and will be able to access local variables from the
stack, etc.
@node Interaction in JS buffers,The stepping debugger,The REPL,Table of contents
@anchor{code-evaluation doc}@anchor{25}@anchor{code-evaluation interaction}@anchor{26}@anchor{code-evaluation interaction-in-js-buffers}@anchor{27}
@section Interaction in JS buffers
Indium comes with a minor mode called @code{indium-interaction-mode} for interactive
programming. To enable it in all JavaScript buffers, add something
like the following to your Emacs configuration:
@example
(require 'indium)
(add-hook 'js-mode-hook #'indium-interaction-mode)
@end example
When @code{indium-interaction-mode} is on, you can evaluate code, inspect objects and
add or remove breakpoints from your buffers.
@menu
* Evaluating and inspecting::
* Switching to the REPL buffer::
* Adding and removing breakpoints::
@end menu
@node Evaluating and inspecting,Switching to the REPL buffer,,Interaction in JS buffers
@anchor{code-evaluation evaluating-and-inspecting}@anchor{28}
@subsection Evaluating and inspecting
Here’s a list of available keybindings:
@itemize -
@item
@code{C-x C-e}: Evaluate the JavaScript expression preceding the point.
@item
@code{C-M-x}: Evaluate the innermost function enclosing the point.
@item
@code{C-c M-i}: Inspect the result of the evaluation of an expression (see
@ref{20,,The inspector}).
@item
@code{C-c M-:}: Prompt for an expression to evaluate and inspect.
@item
@code{M-x indium-eval-buffer}: Evaluate the entire buffer.
@item
@code{M-x indium-eval-region}: Evaluate the current region.
@end itemize
@node Switching to the REPL buffer,Adding and removing breakpoints,Evaluating and inspecting,Interaction in JS buffers
@anchor{code-evaluation switching-to-the-repl-buffer}@anchor{29}
@subsection Switching to the REPL buffer
Press @code{C-c C-z} from any buffer with @code{indium-interaction-mode} turned on to
switch back to the REPL buffer (see @ref{1d,,The REPL}).
@node Adding and removing breakpoints,,Switching to the REPL buffer,Interaction in JS buffers
@anchor{code-evaluation adding-and-removing-breakpoints}@anchor{2a}
@subsection Adding and removing breakpoints
You need to first make sure that Indium is set up correctly to use local files
(see @ref{12,,General configuration}).
@itemize -
@item
@code{C-c b b}: Add a breakpoint
@item
@code{C-c b c}: Add a conditional breakpoint
@item
@code{C-c b k}: Remove a breakpoint
@item
@code{C-c b t}: Toggle a breakpoint
@item
@code{C-c b K}: Remove all breakpoints from the current buffer
@item
@code{C-c b e}: Edit condition of a breakpoint
@item
@code{C-c b l}: List all breakpoints and easily jump to any breakpoint
@item
@code{C-c b d}: Deactivate all breakpoints (the runtime won’t pause when hitting a breakpoint)
@item
@code{C-c b a}: Activate all breakpoints (it has no effect if breakpoints have not been deactivated)
@end itemize
The left fringe or margin can also be clicked to add or remove breakpoints.
Once a breakpoint is set, execution will stop when a breakpoint is hit, and the
Indium debugger pops up (see @ref{2b,,The stepping debugger}).
Since Indium 0.7, breakpoints are supported in source files with an associated sourcemap, see @ref{14,,Using sourcemaps}.
@cartouche
@quotation Note
Breakpoints are persistent: if the connection is closed, when a new
connection is made Indium will attempt to add back all breakpoints.
@end quotation
@end cartouche
@node The stepping debugger,The inspector,Interaction in JS buffers,Table of contents
@anchor{debugger doc}@anchor{2c}@anchor{debugger debugger}@anchor{2b}@anchor{debugger the-stepping-debugger}@anchor{2d}
@section The stepping debugger
@menu
* Using sourcemaps::
* Blackboxing scripts::
@end menu
@node Using sourcemaps,Blackboxing scripts,,The stepping debugger
@anchor{debugger sourcemaps}@anchor{14}@anchor{debugger using-sourcemaps}@anchor{2e}
@subsection Using sourcemaps
Since version 0.7, Indium uses sourcemap files by default.
For sourcemaps to work properly with Chrome/Chromium, make sure that a
workspace is correctly set (see @ref{d,,Getting up and running}).
@cartouche
@quotation Warning
If your project uses sourcemaps, we advise you to use @code{js-mode}
with @code{js2-minor-mode} instead of @code{js2-mode}. @code{js2-mode} can
be extremely slow at parsing large files (like compiled JavaScript
files) that the debugger might open if a stack frame source is not
source-mapped. This can happen for instance when using Webpack.
@end quotation
@end cartouche
@menu
* Overriding sourcemap paths::
* Setting a different remote root (NodeJS): Setting a different remote root NodeJS.
@end menu
@node Overriding sourcemap paths,Setting a different remote root NodeJS,,Using sourcemaps
@anchor{debugger overriding-sourcemap-paths}@anchor{2f}@anchor{debugger webpack}@anchor{30}
@subsubsection Overriding sourcemap paths
Some sourcemaps cannot be used as is and need path rewriting to map to locations on disks.
Indium provides the configuration option @code{sourceMapPathOverrides} for
providing custom sourcemap paths.
The default mapping works well for Webpack projects:
@example
@{
"webpack:///./~/": "$@{root@}/node_modules/",
"webpack:///./": "$@{root@}/",
"webpack:///": "/",
"webpack:///src/": "$@{root@}/"
@}
@end example
Overriding the @code{sourceMapPathOverrides} option will erase the default mapping.
@cartouche
@quotation Tip
If sourcemaps do not seem to work, you can see how Indium resolves
sourcemap paths using @code{M-x indium-list-sourcemap-sources}.
@end quotation
@end cartouche
@node Setting a different remote root NodeJS,,Overriding sourcemap paths,Using sourcemaps
@anchor{debugger remoteroot}@anchor{17}@anchor{debugger setting-a-different-remote-root-nodejs}@anchor{31}
@subsubsection Setting a different remote root (NodeJS)
When running a NodeJS application on a remote machine or inside a Docker
container, your application’s root folder path might not correspond to where
their source code is located on your local disk.
In this case, you can tell Indium to replace the @code{root} path with a different
location using the @code{remoteRoot} configuration option.
@quotation
@table @asis
@item @{
“remoteRoot”: “/var/task”
@end table
@}
@end quotation
Note that @code{remoteRoot} can be used together with the @code{root} configuration
option.
@node Blackboxing scripts,,Using sourcemaps,The stepping debugger
@anchor{debugger blackboxing-scripts}@anchor{32}
@subsection Blackboxing scripts
The custom variable @code{indium-debugger-blackbox-regexps} holds a list of regular
expression of script paths to blackbox when debugging.
Blackboxed scripts are skipped when stepping in the debugger.
@node The inspector,Troubleshooting,The stepping debugger,Table of contents
@anchor{inspector doc}@anchor{33}@anchor{inspector inspector}@anchor{20}@anchor{inspector the-inspector}@anchor{34}
@section The inspector
Indium features an object inspector that can be open on any object reference
from a REPL buffer (see @ref{1d,,The REPL}), the debugger (see @ref{2b,,The stepping debugger}), or
the result of any evaluation of JavaScript code (see @ref{26,,Interaction in JS buffers}).
To inspect the result of the evaluation of an expression, press @code{C-c M-i}. An
inspector buffer will pop up. You can also press @code{RET} or left click on
object links from the REPL buffer.
@image{inspector,,,,png}
@menu
* Using the inspector::
@end menu
@node Using the inspector,,,The inspector
@anchor{inspector using-the-inspector}@anchor{35}
@subsection Using the inspector
Here is a list of available keybindings in an inspector buffer:
@multitable {xxxxxxxxxxxxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
@headitem
Keybinding
@tab
Description
@item
@code{RET}
@tab
Follow a link to inspect the object at point
@item
@code{l}
@tab
Pop to the previous inspected object
@item
@code{g}
@tab
Update the inspector buffer
@item
@code{n} or @code{TAB}
@tab
Jump to the next object in the inspector
@item
@code{p} or @code{s-TAB}
@tab
Jump to the previous object in the inspector
@end multitable
@node Troubleshooting,,The inspector,Table of contents
@anchor{troubleshooting doc}@anchor{36}@anchor{troubleshooting troubleshooting}@anchor{37}
@section Troubleshooting
If you run into issues with Indium, this document might help you.
@menu
* General advice before reporting issues::
* The Indium server doesn’t start::
* Breakpoints are not set (not using sourcemaps): Breakpoints are not set not using sourcemaps.
* Breakpoints and debugging do not work (using sourcemaps): Breakpoints and debugging do not work using sourcemaps.
@end menu
@node General advice before reporting issues,The Indium server doesn’t start,,Troubleshooting
@anchor{troubleshooting general-advice-before-reporting-issues}@anchor{38}
@subsection General advice before reporting issues
Issues should be reported on the GitHub issue tracker@footnote{https://github.com/nicolaspetton/indium/issues}.
1. If you encounter errors, you can enable @code{debug-on-error} in Emacs using @code{M-x
toggle-debug-on-error} and report an issue with the backtrace.
2. It is also a good idea to turn on Indium’s log mode with @code{M-: (setq
indium-client-debug t)}, and attach to the issue report the contents of the
@code{*indium-debug-log*} buffer to help resolve the issue.
Attaching the contents of the @code{*indium-process*} buffer can help as well in
case an error happens in the server process.
@node The Indium server doesn’t start,Breakpoints are not set not using sourcemaps,General advice before reporting issues,Troubleshooting
@anchor{troubleshooting the-indium-server-doesn-t-start}@anchor{39}
@subsection The Indium server doesn’t start
First, make sure that @code{indium} is installed as documented in the
@ref{7,,The Indium server} section.
If you encounter the error:
@example
"error in process filter: Indium server process error: env: node: No such file or directory"
@end example
Chances are that @code{node} is not in Emacs’ @code{exec-path}. In this case, you can
fix it by appending the correct directory to @code{exec-path}, or use the
exec-path-from-shell@footnote{https://melpa.org/#/exec-path-from-shell} package:
@example
(require 'exec-path-from-shell)
(exec-path-from-shell-initialize)
@end example
@node Breakpoints are not set not using sourcemaps,Breakpoints and debugging do not work using sourcemaps,The Indium server doesn’t start,Troubleshooting
@anchor{troubleshooting breakpoints-are-not-set-not-using-sourcemaps}@anchor{3a}
@subsection Breakpoints are not set (not using sourcemaps)
If breakpoints do not work, chances are that the project is not configured
correctly.
@cartouche
@quotation Note
Indium needs to know how to map script source urls to files on disk.
It uses the @code{root} (alias @code{webRoot}) configuration option as the
base path, as described in the @ref{12,,General configuration} page.
@end quotation
@end cartouche
Indium provides a command @code{indium-list-script-sources} to list all scripts
parsed by the backend, displaying their sources mapped to files on disk. Check
that the file where you’re trying to add a breakpoint is listed.
@node Breakpoints and debugging do not work using sourcemaps,,Breakpoints are not set not using sourcemaps,Troubleshooting
@anchor{troubleshooting breakpoints-and-debugging-do-not-work-using-sourcemaps}@anchor{3b}
@subsection Breakpoints and debugging do not work (using sourcemaps)
Correctly mapping sourcemaps to file locations can be tedious (see
@ref{14,,Using sourcemaps}).
Indium provides the command @code{indium-list-sourcemap-sources} to help
configuring sourcemaps correctly. This command displays a list of all
sourcemap sources in the runtime as file paths on disk. Check that your files
are listed there.
@node Indices and tables,,Table of contents,Top
@anchor{index indices-and-tables}@anchor{3c}
@chapter Indices and tables
@itemize *
@item
genindex
@item
modindex
@item
search
@end itemize
@c %**end of body
@bye