GoogleChromeLabs / GoogleChromeLabs/native-url

'node_modules/native-url/third_party/url.d.ts' is not a module.

Open
#34 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
286
Forks
11
PR merge metrics
No merged PRs in 30d

Description

## Expected Behavior

I expected TypeScript to not complain since there are built-in declarations

## Actual Behavior

TypeScript throws an error

```
main.ts:1:17 - error TS2306: File 'G:/experiments/node_modules/native-url/third_party/url.d.ts' is not a module.

1 import url from "native-url";
```

![image](https://user-images.githubusercontent.com/75625083/110344202-4f32f780-803e-11eb-824c-7fe1ac3b8793.png)

## Steps to Reproduce the Problem

1. Create a TypeScript project with both '@types/node' and 'native-url' installed
2. Try to compile it

tsconfig.json:
```json
{
"compilerOptions": {
"strict": true
}
}
```

## Specifications

- Version: Node v14.15.1
- Platform: Windows 10

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the TypeScript error with the stated tsconfig.json, @types/node, and native-url installed. Inspect node_modules/native-url/third_party/url.d.ts and the package's declaration entry points. Done means the example import compiles without TS2306 while preserving the package's existing declarations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, typescript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.