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
{{ message }}
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
While trying to use the new gemini SDK in my nestJS server I get this error:
err:
require() of ES Module path-toproject\dist\gemini\gemini.service.js not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in node_modules\.pnpm\@google+genai@1.0.0_@modelcontextprotocol+sdk@1.11.2\node_modules\@google\genai\package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
I've tried updating my config and using dynamic imports, but it doesn't seem to work. Can this be addressed?
Actual vs expected behavior:
Server is unable to start
Any other information you'd like to share?
Note:
Server is unable to start to import the bundle properly, can be fixed by changing tsconfig props but that is incompatible with NestJS configurations
Description of the bug:
While trying to use the new gemini SDK in my nestJS server I get this error:
err:
I've tried updating my config and using dynamic imports, but it doesn't seem to work. Can this be addressed?
Actual vs expected behavior:
Server is unable to start
Any other information you'd like to share?
Note:
Server is unable to start to import the bundle properly, can be fixed by changing tsconfig props but that is incompatible with NestJS configurations