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
Version 1.0.25 introduced a breaking change that affects ESM imports. When using the package in an ESM context (with "type": "module" in package.json), the following error occurs during runtime:
import { SerpApi, SerpTaskRequestInfo, DataforseoLabsApi, DataforseoLabsGoogleHistoricalSearchVolumeLiveRequestInfo, DataforseoLabsGoogleKeywordIdeasLiveRequestInfo, DataforseoLabsGoogleKeywordsForSiteLiveRequestInfo, BusinessDataApi, BusinessDataGoogleMyBusinessInfoLiveTaskInfo, AppendixApi, AppendixWebhookResendRequestInfo } from 'dataforseo-client';
^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'SerpTaskRequestInfo' not found. The requested module 'dataforseo-client' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'dataforseo-client';
const { SerpApi, SerpTaskRequestInfo, DataforseoLabsApi, DataforseoLabsGoogleHistoricalSearchVolumeLiveRequestInfo, DataforseoLabsGoogleKeywordIdeasLiveRequestInfo, DataforseoLabsGoogleKeywordsForSiteLiveRequestInfo, BusinessDataApi, BusinessDataGoogleMyBusinessInfoLiveTaskInfo, AppendixApi, AppendixWebhookResendRequestInfo } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async loadModule (/Users/BenJackGill/Dev/seoturbo/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/firebase-functions/lib/runtime/loader.js:48:20)
at async loadStack (/Users/BenJackGill/Dev/seoturbo/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/firebase-functions/lib/runtime/loader.js:157:17)
at async /Users/BenJackGill/Dev/seoturbo/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/firebase-functions/lib/bin/firebase-functions.js:56:27
The suggested fix in the error message does not work either because ISerpTaskRequestInfo and SerpTaskRequestInfo are not exported.
Were they removed on purpose or by accident? Maybe they got renamed? I am unsure what to use in their place.
Environment
Node.js version: 20
dataforseo-client version: 1.0.25
Project type: ESM ("type": "module" in package.json)
Steps to Reproduce
Set up a Node.js project with "type": "module" in package.json
Hi, yes, in versions 1.0.25+ we decided to make each request model unique (for each endpoint) to avoid a situation where some endpoint with a common request model would need to add a new parameter that is not required for other endpoints with the same common model. You can find the model you need by exploring the endpoint you are using, or by searching the documentation
Description
Version 1.0.25 introduced a breaking change that affects ESM imports. When using the package in an ESM context (with
"type": "module"
in package.json), the following error occurs during runtime:The suggested fix in the error message does not work either because
ISerpTaskRequestInfo
andSerpTaskRequestInfo
are not exported.Were they removed on purpose or by accident? Maybe they got renamed? I am unsure what to use in their place.
Environment
"type": "module"
in package.json)Steps to Reproduce
"type": "module"
in package.jsonExpected Behavior
Named imports should work as they did in version 1.0.24 and below.
Current Behavior
The module fails to load with an export error.
The text was updated successfully, but these errors were encountered: