sern-handler / handler

Create your dream Discord bot!
https://sern.dev
MIT License
38 stars 9 forks source link

[BUG] sern handler fails to resolve typings for moduleResolution: "nodenext" #284

Closed jacoobes closed 1 year ago

jacoobes commented 1 year ago

Building with module resolution 'nodenext' fails with this error

Could not find a declaration file for module '@sern/handler'. 'C:/Users/~/OneDrive/Desktop/Projects/~/node_modules/@sern/handler/dist/esm/index.mjs' implicitly has an 'any' type.
  There are types at 'C:/Users/~/OneDrive/Desktop/Projects/~/node_modules/@sern/handler/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@sern/handler' library may need to update its package.json or typings

To Reproduce Steps to reproduce the behavior:

  1. Create a new typescript project with sern init
  2. switch to an esm configuration
  3. module resolution in tsconfig.json should be 'nodenext'
  4. See error

Expected behavior Typings should work

Screenshots If applicable, add screenshots to help explain your problem.

Versioning NodeJS version: 17.6.0 DiscordJS version: 14.9.1 SernHandler version: 2.6.1 Channel: (e.g. beta)

Additional context Add any other context about the problem here.

EvolutionX-10 commented 1 year ago
"moduleResolution": "node",

adding this in compilerOptions inside tsconfig.json fixes it

Murtatrxx commented 1 year ago

Can confirm Evo (reopening in case it continues)

jacoobes commented 1 year ago

yeah, this bug works with moduleResolution work with "node", however, wondering what could be the issue for a "nodenext" project.

jacoobes commented 1 year ago

Found the issue. will be fixed in v3 #molszanski/iti/37

294