-
Notifications
You must be signed in to change notification settings - Fork 1
Description
ESM webdav package not working with NestJS setup using CommonJS. This blocks npm run start:dev from working out of the gate with the default code.
`[8:35:17 PM] Starting compilation in watch mode...
[8:35:26 PM] Found 0 errors. Watching for file changes.
[dotenv@17.2.2] injecting env (0) from .env -- tip: ⚙️ specify custom .env file path with { path: '/custom/path/.env' }
C:\Users\Matias.DESKTOP-2SBTD6B\Desktop\Altzone-Server\dist\gameAnalytics\logFile.service.js:19
const webdav_1 = require("webdav");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\Matias.DESKTOP-2SBTD6B\Desktop\Altzone-Server\node_modules\webdav\dist\node\index.js from C:\Users\Matias.DESKTOP-2SBTD6B\Desktop\Altzone-Server\dist\gameAnalytics\logFile.service.js not supported.
Instead change the require of index.js in C:\Users\Matias.DESKTOP-2SBTD6B\Desktop\Altzone-Server\dist\gameAnalytics\logFile.service.js to a dynamic import() which is available in all CommonJS modules.
at Object. (C:\Users\Matias.DESKTOP-2SBTD6B\Desktop\Altzone-Server\dist\gameAnalytics\logFile.service.js:19:18) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v20.11.0
This is the error output. The fix has already been done by me. This issue is just for documentation purposes.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status