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

unable to make it work #253

Open
adan-ea opened this issue Aug 16, 2023 · 3 comments
Open

unable to make it work #253

adan-ea opened this issue Aug 16, 2023 · 3 comments

Comments

@adan-ea
Copy link

adan-ea commented Aug 16, 2023

Hi, I've looked at the examples, the documentation, the issues and nothing seemed to help. Sorry for the useless issue..
I tried different types of import like ./src/* ../src/* src/*
No matter what I do, I end up with this :
Promise {
Error: Cannot find module 'src/utils/Logger'
Require stack:

  • C:\Users\user\Documents\project\dist\src\handlers\taskHandler.js
  • C:\Users\user\Documents\project\dist\index.js

Here is some more context :
Node: v18.12.1 tsconfig-path: v4.2.0 | tsc: v4.9.4 | npm: v9.8.1
the command : tsc && node -r tsconfig-paths/register dist/index.js

tsconfig.json

{
  "compilerOptions": {
      /* Language and Environment */
      "target": "es2021",

      /* Modules */
      "module": "commonjs",
      "resolveJsonModule": true,

      "types": ["node"],
      /* Emit */
      "sourceMap": false,
      "outDir": "dist",
      "baseUrl": ".",
      "paths": {
          "*": ["./src/*"],
          "client": ["./index"],
          "core/*": ["./src/modules/core/*"],
          "qotd/*": ["./src/modules/qotd/*"],
          "scheduledEvents/*": ["./src/modules/customEvents/*"],
          "tempVoice/*": ["./src/modules/tempVoice/*"],
          "twitchLive/*": ["./src/modules/twitchLive/*"]
      },
      /* Interop Constraints */
      "esModuleInterop": true,
      "forceConsistentCasingInFileNames": true,

      /* Type Checking */
      "strict": true,
      "noImplicitAny": true,
      "strictNullChecks": true,
      "strictFunctionTypes": true,
      "strictPropertyInitialization": true,
      "noImplicitThis": true,
      "useUnknownInCatchVariables": true,
      "alwaysStrict": true,
      "noUnusedLocals": false,
      "exactOptionalPropertyTypes": false,
      "noImplicitReturns": false,
      "noImplicitOverride": true,

      /* Completeness */
      "skipLibCheck": true
  },
  "include": ["src/**/*.ts", "tsconfig.json", "index.ts"]
}

My project tree :

project
├── dist
│   ├── index.js
│   ├── src
│   │   ├── client.js
│   │   ├── handlers
│   │   ├── models
│   │   ├── modules
│   │   │   ├── core
│   │   │   ├── customEvents
│   │   │   ├── qotd
│   │   │   ├── tempVoice
│   │   │   └── twitchLive
│   │   ├── services
│   │   └── utils
│   │       ├── Logger.js
│   └── tsconfig.json
├── index.ts
├── src
│   ├── client.ts
│   ├── handlers
│   ├── models
│   ├── modules
│   │   ├── core
│   │   ├── customEvents
│   │   ├── qotd
│   │   ├── tempVoice
│   │   └── twitchLive
│   ├── services
│   └── utils
│       ├── Logger.ts
└── tsconfig.json
@Fritiof
Copy link

Fritiof commented Aug 24, 2023

Don't know if it helps you but I do this and it works, not using the asterix:

{ "paths": { "@vegitables/tomato": ["../../packages/tomato/src"] } }

@quantuminformation
Copy link

no luck

image

works fine relatively or with normal tsx mode

@sahilshahane
Copy link

@quantuminformation
Same here, tried everything, changed node version, removed node_modules. nothing works

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

4 participants