Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] URL is not a constructor #5372

Closed
zalishchuk opened this issue Jul 25, 2017 · 4 comments
Closed

[bug] URL is not a constructor #5372

zalishchuk opened this issue Jul 25, 2017 · 4 comments

Comments

@zalishchuk
Copy link

zalishchuk commented Jul 25, 2017

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

@sokra
Copy link
Member

sokra commented Jul 26, 2017

@webpack-bot move to defunctzombie/node-url

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

@webpack-bot
Copy link
Contributor

I've moved it to defunctzombie/node-url.

@zalishchuk
Copy link
Author

zalishchuk commented Jul 26, 2017

@sokra node-url does not support new API at all, last update was 3 years ago, can we replace this deprecated module with a new one?

@sokra
Copy link
Member

sokra commented Jul 26, 2017

Sure if you have one. See webpack/node-libs-browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants