Skip to content
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

Example app broken? #66

Open
kpassapk opened this issue Jan 8, 2025 · 0 comments
Open

Example app broken? #66

kpassapk opened this issue Jan 8, 2025 · 0 comments

Comments

@kpassapk
Copy link

kpassapk commented Jan 8, 2025

Hi,

I am trying to start the example app from the master branch.

Expected behavior

When I run

npm install
npm start

Then the application should start

Actual behavior

> [email protected] start
> ts-node -r tsconfig-paths/register src/main.ts

/Users/kyle/src/github.com/SoftwareBrothers/adminjs-nestjs/example-app/node_modules/ts-node/dist-raw/node-internal-errors.js:46
  const err = new Error(getErrRequireEsmMessage(filename, parentPath, packageJsonPath))
              ^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/kyle/src/github.com/SoftwareBrothers/adminjs-nestjs/src/index.ts
require() of ES modules is not supported.
require() of /Users/kyle/src/github.com/SoftwareBrothers/adminjs-nestjs/src/index.ts from /Users/kyle/src/github.com/SoftwareBrothers/adminjs-nestjs/example-app/src/app.module.ts is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from /Users/kyle/src/github.com/SoftwareBrothers/adminjs-nestjs/package.json.

....

    at Object.<anonymous> (/Users/kyle/src/github.com/SoftwareBrothers/adminjs-nestjs/example-app/src/app.module.ts:7:1) {
  code: 'ERR_REQUIRE_ESM'
}

Environment

Node v22.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant