Title: ReferenceError: exports is not defined on NestJS project · Issue #21 · dataforseo/TypeScriptClient · GitHub
Open Graph Title: ReferenceError: exports is not defined on NestJS project · Issue #21 · dataforseo/TypeScriptClient
X Title: ReferenceError: exports is not defined on NestJS project · Issue #21 · dataforseo/TypeScriptClient
Description: Description In a NestJS project, the package fails at runtime with the error: file:///demo/node_modules/.pnpm/dataforseo-client@2.0.17/node_modules/dataforseo-client/dist/cjs/index.js:2 Object.defineProperty(exports, "__esModule", { valu...
Open Graph Description: Description In a NestJS project, the package fails at runtime with the error: file:///demo/node_modules/.pnpm/dataforseo-client@2.0.17/node_modules/dataforseo-client/dist/cjs/index.js:2 Object.defi...
X Description: Description In a NestJS project, the package fails at runtime with the error: file:///demo/node_modules/.pnpm/dataforseo-client@2.0.17/node_modules/dataforseo-client/dist/cjs/index.js:2 Object.defi...
Opengraph URL: https://github.com/dataforseo/TypeScriptClient/issues/21
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ReferenceError: exports is not defined on NestJS project","articleBody":"### Description\n\nIn a [NestJS](https://nestjs.com/) project, the package fails at runtime with the error:\n\n```\nfile:///demo/node_modules/.pnpm/dataforseo-client@2.0.17/node_modules/dataforseo-client/dist/cjs/index.js:2\nObject.defineProperty(exports, \"__esModule\", { value: true });\n ^\n\nReferenceError: exports is not defined\n at file:///demo/node_modules/.pnpm/dataforseo-client@2.0.17/node_modules/dataforseo-client/dist/cjs/index.js:2:23\n at ModuleJobSync.runSync (node:internal/modules/esm/module_job:400:35)\n at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:427:47)\n at loadESMFromCJS (node:internal/modules/cjs/loader:1561:24)\n at Module._compile (node:internal/modules/cjs/loader:1712:5)\n at Object..js (node:internal/modules/cjs/loader:1895:10)\n at Module.load (node:internal/modules/cjs/loader:1465:32)\n at Function._load (node:internal/modules/cjs/loader:1282:12)\n at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)\n```\n\n### Environment\n\n- Node.js version: 22.16\n- dataforseo-client version: 2.0.17\n\n### Steps to Reproduce\n\n1. Set up a new NestJS project with:\n```\npnpm add -g @nestjs/cli\nnest new demo\n```\n2. Install dataforseo-client@2.0.17\n3. Add the following example code to the main.ts file for testing:\n```\nimport { BacklinksApi } from 'dataforseo-client';\nnew BacklinksApi();\n```\n4. Run the project with `pnpm start:dev` to see the error.\n\n### Expected Behavior\nImports should work without throwing an error.\n\n### Current Behavior\nThe module fails to load with an export-undefined error.\n\n**Note:** The last version of dataforseo-client I'm able to use without issue is **1.0.31**.","author":{"url":"https://github.com/sabbirrahman","@type":"Person","name":"sabbirrahman"},"datePublished":"2026-01-24T06:48:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/21/TypeScriptClient/issues/21"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:99707e92-37e5-12f0-75cf-9d2f5ebb39a3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFCA:4FC34:114E389:175B0D1:69813421 |
| html-safe-nonce | e881f81603fc3e9b1776bd4bacb5964f590cde99abe3b740f9fa6f28bbf21bb3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkNBOjRGQzM0OjExNEUzODk6MTc1QjBEMTo2OTgxMzQyMSIsInZpc2l0b3JfaWQiOiI0Nzc2MjE5OTQ1NDA1Nzc4MjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 638497f80072888d33d5881d79d4aa9d895f53136a1a675aed0557865e344454 |
| hovercard-subject-tag | issue:3850431487 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/dataforseo/TypeScriptClient/21/issue_layout |
| twitter:image | https://opengraph.githubassets.com/49b409056830ae40781e5c9d2a715d27f87de05e05fa22172d2a4fe83a47158b/dataforseo/TypeScriptClient/issues/21 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/49b409056830ae40781e5c9d2a715d27f87de05e05fa22172d2a4fe83a47158b/dataforseo/TypeScriptClient/issues/21 |
| og:image:alt | Description In a NestJS project, the package fails at runtime with the error: file:///demo/node_modules/.pnpm/dataforseo-client@2.0.17/node_modules/dataforseo-client/dist/cjs/index.js:2 Object.defi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sabbirrahman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 39fe8101494cbb823c09b619b68c80cd4d05ab7279997038dbe06bb91608abe1 |
| turbo-cache-control | no-preview |
| go-import | github.com/dataforseo/TypeScriptClient git https://github.com/dataforseo/TypeScriptClient.git |
| octolytics-dimension-user_id | 29703714 |
| octolytics-dimension-user_login | dataforseo |
| octolytics-dimension-repository_id | 766643029 |
| octolytics-dimension-repository_nwo | dataforseo/TypeScriptClient |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 766643029 |
| octolytics-dimension-repository_network_root_nwo | dataforseo/TypeScriptClient |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d5b34a4e4898b066c629879feb4b184bc471d6a7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width