Skip to content

Cannot find name 'URL' when running in Node.js #14

@fausto-m

Description

@fausto-m

The following declaration file is missing an import so that it resolves the URL type in the following line, when using your package to run an application in Node.js:

export function parseFile(path: string | Buffer | URL | number, encoding?: string): Promise<Properties> {

I get the following error when trying to compile my application using yarn:

error TS2304: Cannot find name 'URL'

Entering import { URL } from 'url' in node-java-props.d.ts solved the issue for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions