mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.08k stars 1.26k forks source link

[x-license] License of MUI X Premium license shows as MUI expired package version #13514

Closed sbitenc closed 3 months ago

sbitenc commented 3 months ago

The problem in depth

I purchased the license recently, and now upgraded to latest package and under my license it says:

Here is more information about your MUI X Premium license.

Development use, support, and updates expiry date:
Jan 11, 2025

However, mui datagrid says MUI expired package version. Can you re-activate the license to work?

Your environment

`npx @mui/envinfo` ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: MUI X Premium license shows as MUI expired package version Order ID: 82010

zannager commented 3 months ago

@sbitenc can you please share the license key you are using in sales@mui.com? Thanks.

sbitenc commented 3 months ago

hi @zannager email with key sent to the sales email

sbitenc commented 3 months ago

Hi @michelengelen could this be looked into, it's blocking my production release?

michelengelen commented 3 months ago

Hey @sbitenc I did just try your key in a production environment and it does work just fine for me. Could you share with us how you registered the license key in code and what kind of setup you use? nextjs, SSR, browser and version, etc.

sbitenc commented 3 months ago

Hi, we use react (latest), with vite. I'm using latest brave browser (the issue is browser agnostic), and the value is injected via

import { LicenseInfo } from '@mui/x-data-grid-premium';

LicenseInfo.setLicenseKey(environmentConfig.REACT_APP_DATAGRID_PRO_KEY);

i now see that the fn is deprecated. Could this be the issue?

But we get the expired license issue when done so (we're using env to inject it)

michelengelen commented 3 months ago

is the component you are injecting this a client component?

sbitenc commented 3 months ago

i'm injecting it right into the app. I'll see how to update the deprecated call first. But here's the code i have

import { mixpanelCookiesManagement } from '@/global/components/cookies-consent-dialog/helpers/mixpanel-cookies-management';
import { removeExpiredCookiesConsent } from '@/global/components/cookies-consent-dialog/helpers/remove-expired-cookies-consent';
import { LicenseInfo } from '@mui/x-data-grid-premium';
import { environmentConfig } from '../environment-config';
import './App.css';
import { AppContent } from './app-content';
import { AppWrapper } from './app-wrapper';
import { tracker } from '@/global/helpers/tracker';

tracker.init();
removeExpiredCookiesConsent();
mixpanelCookiesManagement();

LicenseInfo.setLicenseKey(environmentConfig.REACT_APP_DATAGRID_PRO_KEY);

export const App: React.FC = () => {
  return (
    <AppWrapper>
      <AppContent />
    </AppWrapper>
  );
};

I'm switching over to @mui/x-license to see if this solves the issue

michelengelen commented 3 months ago

let me quickly set up a vite project and test it there... In the meantime could you try and test this approach?

I think we should add a section on vite as well ... wdyt @joserodolfofreitas ?

sbitenc commented 3 months ago

I've changed from import { LicenseInfo } from '@mui/x-data-grid-premium'; to import { LicenseInfo } from '@mui/x-license';

And it seems to be working. I didn't add the use client though, but it looks good on local, i'm deploying right now to see if it works on stage. But otherwise it seems to fix the issue 🤞

joserodolfofreitas commented 3 months ago

let me quickly set up a vite project and test it there... In the meantime could you try and test this approach?

I think we should add a section on vite as well ... wdyt @joserodolfofreitas ?

That sounds like a good idea, @michelengelen! Let's do it!

michelengelen commented 3 months ago

OK @sbitenc I just tested it with a production build and it works fine for me. Sry for didn't noticing you were importing LicenseInfo from the premium package. This should be marked as deprecated, is it not?

Did it work after importing from the license package?

sbitenc commented 3 months ago

Hi, yes that resolved the issue!

Thanks for the help!

michelengelen commented 3 months ago

Great that we could help! 👍🏼

github-actions[bot] commented 3 months ago

:warning: This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@sbitenc: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.