Skip to content

Not Supported in Webpack 5 #22

@alettieri

Description

@alettieri

Given that Webpack 5 no longer supports polyfills node modules, the require statement for url is no longer supported in browsers.

Users will see a build error asking to manually resolve the url module.

There are a couple of options for consumers of this library to work around this, one you can manually resolve this using the node-url package and adding this to your webpack config:

    resolve: {
        fallback: {
            url: path.resolve(__dirname, '/node_modules/url/url.js'),
        },
    },

The other option, in this case is to use the URL class (node, MDN) class to handle parsing of urls, which should work in both web and node environments.

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