You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I have an import fs from 'fs/promises'; or similar in my code base, this gets transpiled to import fs from "../../../promises";, causing an error such as this:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/cdauth/Documents/workspace/programming/web/osm/facilmap/promises' imported from /home/cdauth/Documents/workspace/programming/web/osm/facilmap/server/node_modules/.bin/esrun-1696190329627.tmp.mjs
code=code.replace(/(?:^|;)import (.*?) from "..\//gm,'import $1 from "../../../',).replace(/(?:^|;)import (.*?) from ".\//gm,'import $1 from "../../');
Here, the ..\/ part in the regular expression matches the fs/. I believe to fix the issue, the ..\/ in the regular expression should become \.\.\/ and the .\/ in the other regular expression should become \.\/.
As a workaround, I can import from node:fs/promises.
The text was updated successfully, but these errors were encountered:
cdauth
added a commit
to FacilMap/facilmap
that referenced
this issue
Nov 14, 2023
When I have an
import fs from 'fs/promises';
or similar in my code base, this gets transpiled toimport fs from "../../../promises";
, causing an error such as this:The problems seems to be in this line:
Here, the
..\/
part in the regular expression matches thefs/
. I believe to fix the issue, the..\/
in the regular expression should become\.\.\/
and the.\/
in the other regular expression should become\.\/
.As a workaround, I can import from
node:fs/promises
.The text was updated successfully, but these errors were encountered: