Skip to content
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

error - ReferenceError: require is not defined in ES module scope, you can use import instead #24

Open
Garinmckayl opened this issue Feb 28, 2023 · 3 comments

Comments

@Garinmckayl
Copy link

This file is being treated as an ES module because it has a '.js' file extension and '/node_modules/convertkit-react/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

@simoncarriere
Copy link

I'm Facing the same issue here. Any current fixes or workarounds?

@dmishh
Copy link

dmishh commented Mar 24, 2023

I have the same problem with NextJS 13

@dmishh
Copy link

dmishh commented Mar 24, 2023

Fixed it by importing ESM file from bin folder:
import ConvertKitForm from 'convertkit-react/bin/convertkit-react.esm'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants