#ERR_REQUIRE_ESM with passport js
1 messages · Page 1 of 1 (latest)
passport.js is an ES module
but you are compiling your TS code into JS using the common JS module system
either:
- enable
esModuleInteropin your tsconfig; this will allow for using the CJSrequire()syntax with ES modules https://www.typescriptlang.org/tsconfig/#esModuleInterop - set the
moduleoption in your tsconfig to"esnext"to emit ESM code, and be able to import ES modules https://www.typescriptlang.org/tsconfig/#module
From allowJs to useDefineForClassFields the TSConfig reference includes information about all of the active compiler flags setting up a TypeScript project.
@crystal wraith