Open ala-n opened 1 month ago
Marginally related to https://github.com/11ty/eleventy/issues/3178
Can you include the command you use to run Eleventy?
Sure,
The actual command in root/11ty-package/pacage.json
(runs in the context of root/11ty-package
) is:
eleventy --serve --incremental -- --env=development
The -- --env=development
part is not directly related to the 11ty server (included just in case it indirectly affects something)
Running through workspaces root (e.g., npm run serve -w 11ty-package
) does not affect path resolution.
Steps to Reproduce
The following project structure (with NPM workspaces):
@11ty/eleventy-dev-server
,@11ty/eleventy
, andmorphdom
, loads here (by the NPM workspaces feature to share dependencies between packages)The server runs in the context of the
root/11ty-package
subpackage.The
domDiff
is enabled (default).Any HTML-related changes lead to an exception during the watch process, with the following error:
Root Cause Details:
The
EleventyDevServer._getFileContents
method tries to read the file content of themorphdom
module (ref), but it cannot resolve the path to the file. It uses the following path as a base./node_modules/morphdom/dist/morphdom-esm.js
to create the followingsearchLocations
:None of them contain
morphdom
, which is underroot/node_modules/morphdom/**
in the current state of things.