You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm really in favor of moving to ESM-only but I feel like one thing hasn't been thought through. It's cooperation with NestJS which still uses CJS and has no plans to move to ESM.
Note that these changes still rely on you not actually updating to ESM, so you will have to await import(<any adminjs package>) to have it work or just import CJS versions.
As for whether it is possible to still set it up Nest-way - maybe, I don't know. It should be in the interest of NestJS maintainers to proceed with that migration because we cannot impede our own product's development based on their choice of not supporting ESM. Technically ESM projects should be able to import CJS packages, but it doesn't seem to be the case here.
Reacted by Pedro Sacramento, Phạm Quyết Thắng and Segfault
Hi,
something is wrong with the nested translations i18next::translator: missingKey pl translation properties.isActive.true Yes
I have this key in my translations:
The column header in the table translates correctly, but the translation in the records is missing:
Having either the property translation or the nested properties (like *.true/*.false) works fine. It only breaks once you have both, and always seems to pick the resource ove the nested ones.
That's right, in an earlier version of AdminJs (6.*) this worked fine
Hi,
something is wrong with the nested translations i18next::translator: missingKey pl translation properties.isActive.true Yes
I have this key in my translations:
The column header in the table translates correctly, but the translation in the records is missing:
Having either the property translation or the nested properties (like *.true/*.false) works fine. It only breaks once you have both, and always seems to pick the resource ove the nested ones.
That's right, in an earlier version of AdminJs (6.*) this worked fine
Seems to be because V06 just got the admin.locales and initialized the redux but V07 does a flatten+unflatten on the locales, so this *.true, *.false etc is now broken.
Hi, I wanted to add AdminJs to my expressjs and typescript project using "adminjs": "^7.2.0" with "@adminjs/express": "^6.0.0", "@adminjs/sequelize": "^4.0.0",
and getting the error Cannot find module '@adminjs/sequelize' or its corresponding type declarations.
Besides that I tried to use AdminJs version 6 but when NPM tries to resolve the version of @adminjs/express and @admin/sequelize it can not resolve the versions of the dependencies in a straigthforward way.
Hi, I wanted to add AdminJs to my expressjs and typescript project using "adminjs": "^7.2.0" with "@adminjs/express": "^6.0.0", "@adminjs/sequelize": "^4.0.0",
and getting the error Cannot find module '@adminjs/sequelize' or its corresponding type declarations.
Besides that I tried to use AdminJs version 6 but when NPM tries to resolve the version of @adminjs/express and @admin/sequelize it can not resolve the versions of the dependencies in a straigthforward way.
Any advice how is the best way to proceed?
Thanks in advance
Juan Manuel
I had that issue as well first, but setting module and moduleResolution to "NodeNext" in the tsconfig.json seems to resolve that issue
Using nodejs 17.3 I get this when I try to start app.js (this is the app.js from the getting started documentation)
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".json" for /Users/rick/projects/rasi/taxservice/node_modules/adminjs/lib/locale/de/translation.json
at new NodeError (node:internal/errors:371:5)
at Object.file: (node:internal/modules/esm/get_format:72:15)
at defaultGetFormat (node:internal/modules/esm/get_format:85:38)
at defaultLoad (node:internal/modules/esm/load:22:14)
at ESMLoader.load (node:internal/modules/esm/loader:359:26)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:280:58)
at new ModuleJob (node:internal/modules/esm/module_job:66:26)
at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:297:17)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:261:34)
at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:81:21) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
Node.js v17.3.0
If I try to go back to an earlier nodejs (e.g. 16.13) it fails on the assert (which requires 17+).
I'm two pages into the getting started tutorial and completely blocked.
Hi,
something is wrong with the nested translations i18next::translator: missingKey pl translation properties.isActive.true Yes
I have this key in my translations:
The column header in the table translates correctly, but the translation in the records is missing:
Having either the property translation or the nested properties (like *.true/*.false) works fine. It only breaks once you have both, and always seems to pick the resource ove the nested ones.
That's right, in an earlier version of AdminJs (6.*) this worked fine
Seems to be because V06 just got the admin.locales and initialized the redux but V07 does a flatten+unflatten on the locales, so this *.true, *.false etc is now broken.
Hey @dziraf do you have in mind when you will be able to fix this issue?
The first one hides the resource from the navigation, but it is still acccessible via URL, while the second correctly shows the resource in navigation.
Is there a simple way to use buildAuthenticatedRouter (express) using 'username' instead of 'email' as the required parameter? I noticed it's coded in types.ts but it's difficult to replace 'authenticate' (AuthenticationOptions) in practice (app.ts). The reason is that in my application a person can reuse its email address (e.g. as staff with multiple roles, as a tenant with multiple shops, or a customer doing business with different tenants) but is always constrained to a distinct username in each instance. So far AdminJS is great, thanks!
Activity
ddresch commentedon Apr 18, 2023
https://www.npmjs.com/package/@adminjs/mongoose the docs are wrong - still showing require statements.
Using this, like in the new example app.
mszula commentedon Apr 18, 2023
Great work guys!
I'm really in favor of moving to ESM-only but I feel like one thing hasn't been thought through. It's cooperation with NestJS which still uses CJS and has no plans to move to ESM.
nestjs/nest#7021
Do you have any solution for that?
dziraf commentedon Apr 19, 2023
@mszula until Nest.js moves to ESM or starts dual packaging, you will either have to set up AdminJS express/fastify way or use dynamic imports:
src/app.module.ts
tsconfig.json
{ "compilerOptions": { // ... "moduleResolution": "nodenext" } }Instead of
import(...).then(...)inapp.module.tsyou can just set it up Express way in main.ts:Note that these changes still rely on you not actually updating to ESM, so you will have to
await import(<any adminjs package>)to have it work or just import CJS versions.As for whether it is possible to still set it up Nest-way - maybe, I don't know. It should be in the interest of NestJS maintainers to proceed with that migration because we cannot impede our own product's development based on their choice of not supporting ESM. Technically ESM projects should be able to import CJS packages, but it doesn't seem to be the case here.
dziraf commentedon Apr 19, 2023
@ddresch Have you managed to fix your problem? From what I can see you just need to make changes to your
tsconfig.json:ddresch commentedon Apr 19, 2023
Yes – I fixed all my issues now. Thanks for your feedback!
Aladinndevolpment commentedon Apr 19, 2023
TypeError: Unknown file extension ".json"
dziraf commentedon Apr 19, 2023
or use alternatives: https://www.stefanjudis.com/snippets/how-to-import-json-files-in-es-modules-node-js/
Aladinndevolpment commentedon Apr 19, 2023
TypeError: Unknown file extension ".json"
Getting this error in adminjs 7 package with nestjs
dziraf commentedon Apr 19, 2023
Can you show full error log? This could be Nest issue since json imports work fine with every other framework I tried.
Aladinndevolpment commentedon Apr 19, 2023
TypeError: Unknown file extension ".json" for E:\application\admin-mode\node_modules\adminjs\lib\locale\de\translation.json
Node version: v16.14.0
dziraf commentedon Apr 19, 2023
@Aladinndevolpment Looks like type assertions are supported from Node 17+
mickyarun commentedon Apr 20, 2023
I am stuck with this issue after upgrading to 7 both themes and typeorm is not detecting though in node_modules it exist

dziraf commentedon Apr 20, 2023
@mickyarun This is the same problem @ddresch had, I think you just have to add:
to your
tsconfig.jsonaeroldb commentedon Apr 23, 2023
@dziraf

is this how I will register the adapter for TypeORM on nestJS?
20 remaining items
radekdp commentedon Jul 28, 2023
That's right, in an earlier version of AdminJs (6.*) this worked fine
smiziara commentedon Aug 2, 2023
Seems to be because V06 just got the admin.locales and initialized the redux but V07 does a flatten+unflatten on the locales, so this *.true, *.false etc is now broken.
juanmav commentedon Aug 10, 2023
Hi, I wanted to add AdminJs to my expressjs and typescript project using "adminjs": "^7.2.0" with "@adminjs/express": "^6.0.0", "@adminjs/sequelize": "^4.0.0",
and getting the error
Cannot find module '@adminjs/sequelize' or its corresponding type declarations.My index.ts
My tsconfig.base.json
{ "compileOnSave": false, "compilerOptions": { "rootDir": ".", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, "target": "es2015", "module": "esnext", "lib": ["es2020", "dom"], "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", "paths": {} }, "exclude": ["node_modules", "tmp"] }Besides that I tried to use AdminJs version 6 but when NPM tries to resolve the version of @adminjs/express and @admin/sequelize it can not resolve the versions of the dependencies in a straigthforward way.
Any advice how is the best way to proceed?
Thanks in advance
Juan Manuel
niyrme commentedon Aug 22, 2023
I had that issue as well first, but setting
moduleandmoduleResolutionto"NodeNext"in thetsconfig.jsonseems to resolve that issuejuanmav commentedon Aug 24, 2023
That helped! However I had to modify the imports in this "hacky" way
rlamorea commentedon Aug 25, 2023
Like @Aladinndevolpment I'm in a catch-22 with the JSON import.
Using express with javascript.
Using nodejs 17.3 I get this when I try to start app.js (this is the app.js from the getting started documentation)
If I try to go back to an earlier nodejs (e.g. 16.13) it fails on the
assert(which requires 17+).I'm two pages into the getting started tutorial and completely blocked.
Node v17.3 might not work, but Node v18.17 does!SOULPWRD commentedon Oct 26, 2023
Hi, yes it is.
Sorry for a late reply. I was waiting until the version 7 gets a bit stable. Unfortunately, the problem still persists.
varshiludani commentedon Nov 14, 2023
Hi @dziraf, I'm facing issues with deleting rows with Hapi and TypeORM. Just created a new project and tried again.
wtime commentedon Nov 17, 2023
Hey @dziraf do you have in mind when you will be able to fix this issue?
asta-nguyen commentedon Dec 21, 2023
Hi, guys cc @dziraf, I faced an issue with filter UI on action list resources.
I'm following the document https://docs.adminjs.co/basics/resource#changing-default-navigation-link to add filter for resource such as my code below:
and I faced an issue with the UI. It looks like:
The filter drawer section display below the table (broken UI)
Please let me know any suggestions to fix this issue. Thank guys.
my versions:
hieupham1203 commentedon Jan 11, 2024
Hi, I see adminjs/mongoose is using MongooseModel.count, but this function is deprecated. I got error. Please check and update.
rushg171 commentedon Jan 13, 2024
Same here! MongooseModel.count() is deprecated! Will it be fixed in the next version?
jakapurg commentedon Jan 25, 2024
Hey guys, a minor issue I found while adding filters on page navigation.
The following two options act differently.
The first one hides the resource from the navigation, but it is still acccessible via URL, while the second correctly shows the resource in navigation.
prsws commentedon Sep 10, 2024
Is there a simple way to use buildAuthenticatedRouter (express) using 'username' instead of 'email' as the required parameter? I noticed it's coded in types.ts but it's difficult to replace 'authenticate' (AuthenticationOptions) in practice (app.ts). The reason is that in my application a person can reuse its email address (e.g. as staff with multiple roles, as a tenant with multiple shops, or a customer doing business with different tenants) but is always constrained to a distinct username in each instance. So far AdminJS is great, thanks!
bmbaron commentedon Feb 4, 2025
I'm having this problem with Node version 23.4.0