-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Admin is crashing after response from api/contexts/Entrypoint (in Loading Screen) #522
Comments
I also encountered the same error. |
Thanks @openforce-jp, your solution works fine :) But there should be an official fix anyways i think |
I'm current experiencing this same problem. I don't understand the proposed solution... the package.json file from the demo has a bunch of extra packages (like next) that I don't want... and it's specifying the same version of api platform that I have installed. What exactly about that package.json is solving this for you? |
I found the actual problem and a workaround if not a solution. That ToggleThemeLegacyButton class is deprecated and line 33 has a bug, not testing whether the property it's accessing acutally exists. To work around it, you can do what the deprecation notice advises and pass the light and dark theme props in explicitly in your admin component as shown here. For instance, here is my revised App.js:
|
Hi i try
but still have the same error Cannot read properties of undefined (reading 'mode') |
I believe it will depend on whether you're using JavaScript or TypeScript. My bet is you're using TypeScript. So maybe you installed ReactAdmin and then install @api-platform/admin on top of that? If you do it that way, the installation will default to TypeScript. I believe if you install per the docs which is just npm i @api-platform/admin, you end up with a JavaScript installation by default. Anyhow, presuming you're working with TypeScript, try this instead:
Basically, you are specifying the newer ToggleThemeButton component to override the deprecated one that is loading by default, and you're passing type safe properties. G |
Hi thank you , it saved the day ! Its strange nobody fixed this in the repo as all new users will have to hack this on order to get it running . Thanks again !! |
Thx @grichards ,your description of this problem and solution very help me. |
I am experiencing the same issue on a fresh API platform distribution install. |
Thanks for the solution @grichards . Can somebody explain how to fix it using the https://github.com/api-platform/api-platform public template? Maybe @pomporov or @LinkolnIV . Thanks in advance for your help! |
This does not work with HydraAdmin component |
API Platform version(s) affected: 3.2.10 (React Admin), PHP Side (3.2.10)
Description
The api-platform/admin Package in Version 3.4.5 is not working with the API Platform Core 3.2.10 in Symfony 6.4.
The Administration interface is in Loading state and is getting the following 3 ajax requests without problems:
But after Getting the Entrypoint response it crashes with an bunch of errors as output:
I tried it with an fresh installation of 6.4, which is showing the react admin welcome screen at the beginning. After adding the first entity (with the MakerBundle and just one field) the behaviour to crash begins again. Same thing in 7.0.1.
How to reproduce
https://github.com/basti4557/apiplatformcrash
The text was updated successfully, but these errors were encountered: