-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add NextJS / Preact matrix to CI tests #180
Comments
On this issue, I'm using info - Collecting page data ...ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and ...\node_modules\@hcaptcha\react-hcaptcha\package.json' contains "type":
"module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at .../node_modules/@hcaptcha/react-hcaptcha/dist/index.js:3:31 Using /** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,
swcMinify: true,
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
transpilePackages: ['@hcaptcha/react-hcaptcha'], // <--- HERE
};
export default config; You then run into this error in ./src/pages/account/sign-in/index.tsx
Attempted import error: '@hcaptcha/react-hcaptcha' does not contain a default export (imported as 'HCaptcha').
info - Collecting page data ..Error: Cannot find module './utils.js' I don't have a Also the |
Hi @thathurtabit, Which version of react-hcaptcha gives you the following error? If you still have that issue when using the latest react-hcaptcha 1.6.0, could you please provide more details on how to reproduce it? Also please feel free to contribute to the project. We really appreciate it. Best Regards, |
Hi @zoryana94 - sorry, my bad. My Also, I should mention I didn't need to use |
Hi @thathurtabit , Thank you for confirming! We appreciate your help a lot! Best Regards, |
v1.5.0 introduced a breaking change in NextJS, as we don't have specific test coverage for it.
It seems like either a test matrix or explicit integration tests are the way to go here.
The text was updated successfully, but these errors were encountered: