What am I doing wrong?
I am following the docs here: https://ej2.syncfusion.com/react/documentation/licensing/overview
syncfusion-license.txt) and running npx syncfusion-license activateI updated all packages to the latest major version and license works now.
Hi Mike Bowles,
Thank you for reaching out to Syncfusion support.
We understand that you are still facing the license validation issue even after following the provided steps. Upon further validation with the provided details, we suspect that you have not replaced the generated license key in the "register license" method. We would like to inform you that you need to add the generated key in place of 'license key' as represented below.
|
// Registering Syncfusion license key registerLicense('Replace your generated license key here'); |
Also, we have found that you are referring to the non-react packages of our controls. For instance, the @syncfusion/ej2 package is a sub-dependency of the component package, and therefore, there is no need to add the ej2 package separately in the application. We kindly request that you remove the following packages from the package.json file mentioned below.
Remove the below non-react packages.
|
"@syncfusion/ej2": "23.1.44", "@syncfusion/ej2-base": "23.1.41", "@syncfusion/ej2-react-base": "23.1.43", |
Kindly ensure that you have followed the below steps once changes are done.
Kindly refer our below documentation licensing FAQ's.
If you require any further assistance or have additional questions, please feel free to let us know.
Regards,
Theveshwar
After adding the license, I'm encountering this error. I'm using React with Next.js and the App Router. Please assist me in resolving the issue.
// Registering Syncfusion license key
registerLicense(myLicense);
Hi Hariprasath,
We have evaluated the issue you reported and understand that you are facing difficulties while registering the license in your Next.js application. The license key can be registered in the src/app/layout.tsx or page.tsx file. Also it is important to include 'use client' at the top of the page to indicate client side component.
|
'use client' import { registerLicense } from '@syncfusion/ej2-base';
// Registering Syncfusion license key registerLicense('Replace your generated license key here');
|
Please ensure that you are using the same major version for all Syncfusion components. Our Syncfusion licenses are version-specific, and if multiple major versions of our components are used in the same application, it can create version conflicts. Therefore, please make sure that you use the same version for all Syncfusion components.
Additionally, this issue may occur due to duplicate packages installed in your application. Follow the below steps to resolve the issue.
If the issue still persists, kindly share the package.json file, so that we can provide a prompt solution.
Regards,
Mohamed
This is my layout.tsx file where you can see how i implemented to register licence key ....
this is my package.json
here in nextjs i am getting this issue
i have implemented same thing in Reactjs there this worked fine but i am getting error in nextjs
is there any possible fixies or i need to work with ReactJs ?
Hi SUMIT MALI,
Thank you for reaching out to Syncfusion support.
We have evaluated the issue you reported and understand that you are facing difficulties while registering the license in your Next.js application. Regarding, Upon evaluating your loayout.tsx file, we have found that you haven’t included 'use client' at the top of the file to notify client side component for client side license validation. So, please ensure that you have included 'use client' at the top to notify client side component:
layout.tsx:
|
'use client' import { registerLicense } from '@syncfusion/ej2-base';
// Registering Syncfusion license key registerLicense('your license key'); |
If still the issue persists or if you need any further assistance reach out to us.
Regards,
Theveshwar
The issue is that the registerLicense function from Syncfusion can only run in a client component. That means we must use frontend environment variables in Next.js, which require the NEXT_PUBLIC prefix.
Our setup runs on AWS EC2 using a Docker image. We store our environment values in AWS Secrets Manager. The backend environment variables work at runtime, but the frontend variables must be available at build time so that Next.js can bundle them into the client.
Right now, Docker does not receive the value for NEXT_PUBLIC_SYNC_FUSION_LICENSE_KEY before the production build. Because the value is missing during next build, it is not included in the client bundle, and registerLicense receives undefined.
My questions:
registerLicense from a server component without using "use client"?
And here is the relevant part of package.json:
PS: I already tried removing ej2 libraries, but the restriction still applies
{"name": "abc","version": "0.1.0","private": true,"scripts": {"dev": "next dev --turbopack","build": "next build","start": "next start","lint": "next lint"},"dependencies": {"@hookform/resolvers": "^5.1.1","@syncfusion/ej2-base": "^30.1.38","@syncfusion/ej2-buttons": "^30.1.37","@syncfusion/ej2-calendars": "^31.1.20","@syncfusion/ej2-data": "^30.1.40","@syncfusion/ej2-dropdowns": "^31.1.20","@syncfusion/ej2-icons": "^30.2.4","@syncfusion/ej2-inputs": "^31.1.20","@syncfusion/ej2-kanban": "^30.1.39","@syncfusion/ej2-layouts": "^30.1.40","@syncfusion/ej2-lists": "^30.1.42","@syncfusion/ej2-navigations": "^30.1.42","@syncfusion/ej2-notifications": "^30.1.37","@syncfusion/ej2-popups": "^30.1.37","@syncfusion/ej2-react-buttons": "^30.1.37","@syncfusion/ej2-react-calendars": "^30.1.37","@syncfusion/ej2-react-dropdowns": "^30.1.39","@syncfusion/ej2-react-grids": "^30.1.39","@syncfusion/ej2-react-inputs": "^30.1.38","@syncfusion/ej2-react-kanban": "^30.1.39","@syncfusion/ej2-react-navigations": "^30.2.5","@syncfusion/ej2-react-notifications": "^30.1.37","@syncfusion/ej2-react-popups": "^30.1.40","@syncfusion/ej2-react-richtexteditor": "^30.2.5","@syncfusion/ej2-react-schedule": "^31.1.20","@syncfusion/ej2-react-splitbuttons": "^30.1.39","@syncfusion/ej2-splitbuttons": "^31.1.17","@tanstack/react-query": "^5.83.0","axios": "^1.10.0","clsx": "^2.1.1","dayjs": "^1.11.13","next": "15.3.5","next-auth": "^5.0.0-beta.27","pluralize": "^8.0.0","react": "^19.0.0","react-dom": "^19.0.0","react-hook-form": "^7.60.0","tailwind-merge": "^3.3.1","zod": "^3.25.75","zsa": "^0.6.0","zsa-react-query": "^0.2.1"},"devDependencies": {"@eslint/eslintrc": "^3","@tailwindcss/postcss": "^4","@types/node": "^20","@types/pluralize": "^0.0.33","@types/react": "^19","@types/react-dom": "^19","eslint": "^9","eslint-config-next": "15.3.5","prettier": "^3.6.2","tailwindcss": "^4","typescript": "^5"}}