motdotla/dotenv

Cannot find module 'node:url' or its corresponding type declarations

P403n1x87 opened this issue · 4 comments

I have included dotenv in one of my VS Code projects, and as a result I am now getting

> austin-vscode@0.16.0 compile
> tsc -p ./

node_modules/dotenv/lib/main.d.ts:3:26 - error TS2307: Cannot find module 'node:url' or its corresponding type declarations.

3 import type { URL } from 'node:url';
                           ~~~~~~~~~~


Found 1 error in node_modules/dotenv/lib/main.d.ts:3

This with the latest version of typescript (5.2.2, but also with 4.1.2) and node 20.8. This is from the CI https://github.com/P403n1x87/austin-vscode/actions/runs/6870690883/job/18686077809. The sources are in this branch, if you're curious about tsconfig etc... https://github.com/P403n1x87/austin-vscode/tree/feat/handle-envfiles-in-tasks

Interesting. maybe the node team changed another dependency recently

Changing

import type { URL } from 'node:url';

to

import type { URL } from 'url';

seems to resolve the issue though

Thank you. I will update in the type doc.

it's reopen again