Skip to content

[BREAKING CHANGE] SyntaxError importing RawSource from webpack-sources #313

@erropix

Description

@erropix

Expected Behavior

The plugin should work as in v5.x without syntax errors when used in a CommonJS Webpack configuration.


Actual Behavior

After upgrading from v5.0.1 → v6.0.0, the build fails with the following error:

[webpack-cli] SyntaxError: The requested module 'webpack-sources' does not provide an export named 'RawSource'
at ModuleJobSync.runSync (node:internal/modules/esm/module_job:440:37)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:435:47)
at loadESMFromCJS (node:internal/modules/cjs/loader:1537:24)
at Module._compile (node:internal/modules/cjs/loader:1688:5)

Additional Information

  • v5 used webpack-sources@2.3.1
  • v6 upgraded to webpack-sources@3.3.3
  • The export format has been changed in webpack-sources@3.3.0

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