Closed hannyudayana closed 4 years ago
if you have 500 error from the backend - you should see something in the terminal where you launch your app. Are there any messages?
There are no error message. These are the only messages shown on the terminal:
POST /admin/login 302 755.036 ms - 56
GET /admin 200 49.321 ms - 185018
GET /admin/frontend/assets/global.bundle.js 304 1.267 ms - -
GET /admin/frontend/assets/app.bundle.js 304 3.597 ms - -
GET /admin/frontend/assets/components.bundle.js 500 6612.001 ms - 2895
GET /admin/frontend/assets/logo-mini.svg 304 1028.448 ms - -
[BABEL] Note: The code generator has deoptimised the styling of D:\Project\node_modules\@ckeditor\ckeditor5-build-classic\build\ckeditor.js as it exceeds the max of 500KB.
ok - can you
Installed the newest version 3.0.1.
Now I am getting some error showing.
'admin-bro/components' is imported by components\my-other-component.jsx, but could not be resolved – treating it as an external dependency
ckeditor error is no more
I tried to change the import from 'admin-bro/components' to '@admin-bro/design-system', the error above is gone, but I still get this error:
GET /admin/frontend/assets/components.bundle.js 500 3062.879 ms - 2895
Versions: "admin-bro": "^3.0.1", "admin-bro-expressjs": "^2.1.1", "admin-bro-sequelizejs": "^0.5.1",
hm - probably you have some middleware which prevents errors from being seen. But there is another way of bundling files: with https://adminbro.com/AdminBro.html#watch method
so when you initialize your AdminBro instance like this: const admin = new AdminBro(options);
immediately after that add admin.watch()
This will prevent /admin/frontend/assets/components.bundle.js
from being generated on every request, but instead, admin will bundle them on every file change.
Since probably you have some error in the components code Admin should throw this in the terminal.
Ah finally. Admin.watch() shows me the error when building my functional component. I wonder why it doesn't show the error without .watch. Thank you so much for your help. I was driven crazy by the issue. Cheers
Hi developer, thank you for pointing me into using the hook to get current admin. I have a functional component as follow:
The problem is, everytime I run the code, I got this error in the console:
Versions: "admin-bro": "^2.9.0", "admin-bro-expressjs": "^2.1.1", "admin-bro-sequelizejs": "^0.5.1",
Any help will be appreciated. Cheers