coapjs / coapjs/node-coap

Any one know if this can be fixed with out the esModuleInterop

Open
#379 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
552
Forks
154
PR merge metrics
No merged PRs in 30d

Description

Think this is caused by the class LRUCache that alos is a namespace. This gets the compiler confused.

node_modules/coap/dist/lib/server.d.ts:11:8 - error TS1259: Module '"coap-service/node_modules/@types/lru-cache/index"' can only be default-imported using the 'esModuleInterop' flag

11 import LRUCache from 'lru-cache';
~~~~~~~~

node_modules/@types/lru-cache/index.d.ts:193:1
193 export = LRUCache;
~~~~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the TypeScript compiler error involving node_modules/coap/dist/lib/server.d.ts and the @types/lru-cache declaration. Start by inspecting the import at server.d.ts:11 and the reported export at index.d.ts:193; done means the package compiles without requiring esModuleInterop.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.