Skip to content

[bug] URL is not a constructor #37

Open
@webpack-bot

Description

@webpack-bot

Do you want to request a feature or report a bug?

Bug with WHATWG URL API provided by native url module.

What is the current behavior?

// ES6

import { URL } from 'url';

console.log(typeof URL); // undefined
// CommonJS

const { URL } = require('url');

console.log(typeof URL); // undefined

If the current behavior is a bug, please provide the steps to reproduce.
I provided code above, is it a normal behavior and we should use Web API URL or WHATWG URL API should be provided through url module?

What is the expected behavior?

// ES6 modules

import { URL } from 'url';

console.log(typeof URL); // function
// CommonJS modules

const { URL } = require('url');

console.log(typeof URL); // function

Please mention your webpack and Operating System version.

node 8.2.1
webpack 3.3.0
macOS Sierra 10.12.6


This issue was moved from webpack/webpack#5372 by @sokra. Orginal issue was by @zalishchuk.

node-url exports it as exports.Url instead of exports.URL

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