-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require() of ES Module \node_modules\klaviyo-api\node_modules\axios\index.js not supported #53
Comments
To help recreate this issue could you provide the node version you are using and the We will try and recreate the issue and find a workaround and/or make a patch. |
Hi, I'm running Node v20.9.0 and I do not have the |
Sounds like a commonJS import issue, Try changing how you are importing the KlaviyoApi to use require. Here is an expressJS example of making an api call while using commonJS imports
Does that fix your issue? |
Thanks, but I get exactly the same error regardless of whether I use import or require |
The team is looking into migrating to fetch, this should eliminate any issues caused by axios incompatibility. |
After installing 7.2.0 and adding the import statement - import { ApiKeySession, ProfileCreateQuery, ProfileEnum, ProfilesApi } from 'klaviyo-api', I get the following error in the compiler...
Error [ERR_REQUIRE_ESM]: require() of ES Module <my_server>\node_modules\klaviyo-api\node_modules\axios\index.js not supported.
Instead change the require of index.js in null to a dynamic import() which is available in all CommonJS modules.
The text was updated successfully, but these errors were encountered: