SoftwareBrothers / adminjs

AdminJS is an admin panel for apps written in node.js

Home Page:https://adminjs.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Errors during transpile

iamart opened this issue · comments

Contact Details

No response

What happened?

Running adminjs create fails with found mongoose 7.9. Empty directory.
Installing manually works, up until I get to transpile. Fails with a bunch of

Cannot find module '@styled-components' or its corresponding type declarations.
Installing this package manually just resolves to
Namespace '"/node_modules/styled-components/dist/index"' has no exported member 'StyledComponent'.

Bug prevalence

all the time

AdminJS dependencies version

7.7.2

What browsers do you see the problem on?

No response

Relevant log output

No response

Relevant code that's giving you issues

No response

The CLI for @adminjs/mongoose broke after the latest version started supporting only mongoose >= 8.0.0. This is now fixed in @adminjs/cli v1.0.5.

The error about @styled-components import that you got comes from the fact that Typescript doesn't rewrite path aliases to relative paths when building d.ts files. The tsconfig.json generated by @adminjs/cli comes with "skipLibCheck": true which makes the error go away but doesn't fix the underlying issue; I'll see if there are any news or workaround for this currently.

You shouldn't install styled-components manually. AdminJS is using a modified version 5.3.5 since the styled-components package wasn't compatible with ESM syntax when we were migrating to it.