-
Notifications
You must be signed in to change notification settings - Fork 639
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
[Bug]: SyntaxError: Named export 'ComponentLoader' not found. The requested module 'adminjs' is a CommonJS module #1605
Comments
It looks to be a Railway integration issue of some kind since we haven't had similar issues with other hosting services. Especially this error:
All latest versions of AJS are ESM-only and there's no CJS code in it's releases. My guess is that Railway runs your code through some kind of wrapper that's written in CommonJS. |
i ve had same issue with Heroku and Google console... |
Could you share your tsconfig if it's a Typescript app? |
Hi!
Thanks for repy... no it's not Typescript app unfortunately...
…On Thu, Mar 21, 2024, 09:57 Rafał Dzięgielewski ***@***.***> wrote:
Could you share your tsconfig if it's a Typescript app?
—
Reply to this email directly, view it on GitHub
<#1605 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGCIPZMXOQONCFAGJIKO4XDYZKOHPAVCNFSM6AAAAABB3MSTTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJRGY3TGMJVGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Do you use Babel or any other JS compiler? Could you try to import everything from import * as AdminJSModule from 'adminjs'
console.log(AdminJSModule) |
Hi ! try this:
|
Contact Details
No response
What happened?
i have implemented Adminjs in my Nodejs app and when i run it locally it works as expected, but when i try to upload it to Railway server i get:
SyntaxError: Named export 'ComponentLoader' not found. The requested module 'adminjs' is a CommonJS module, which may not support all module.exports as named exports.
Bug prevalence
whenever i upload to Railway server
AdminJS dependencies version
"@adminjs/design-system": "^4.0.3",
"@adminjs/express": "^6.0.1",
"@adminjs/sequelize": "^4.0.0",
"adminjs": "^7.5.2",
What browsers do you see the problem on?
No response
Relevant log output
Relevant code that's giving you issues
The text was updated successfully, but these errors were encountered: