Skip to content

Webpack error #34

@djejaquino

Description

@djejaquino

Following the instructions provided in README.md causes webpack to throw the following error:

Module not found: Error: Can't resolve 'url' in '{projectPath}/node_modules/@saucelabs/theme-github-codeblock/build/theme/ReferenceCodeBlock'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
        - install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "url": false }
client (webpack 5.75.0) compiled with 1 error

Apparently in order to use this theme, you need to manually configure webpack to include or ignore that url module. This happens because this theme imports Node's url module, and this doesn't really fix it.

Based on that, I have a few suggestions to tackle this problem:

  1. Document the steps to either polyfill or ignore the url module;
  2. Provide a plugin that does that automatically;
  3. Remove dependency on url module;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions