[ESCONF-16] webpack 5.70 vomits uncontrollably Created: 01/Apr/22  Updated: 20/Dec/22  Resolved: 01/Apr/22

Status: Closed
Project: eslint-config-stripes
Components: None
Affects versions: None
Fix versions: 6.1.1, 6.2.0

Type: Task Priority: TBD
Reporter: Zak Burke Assignee: Zak Burke
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Cloners
clones STCLI-195 webpack 5.70 vomits uncontrollably Closed
Relates
relates to ESCONF-28 unpin webpack dependency Closed
Sprint: Prokopovych - Sprint 136
Story Points: 5
Development Team: Prokopovych
RCA Group: TBD

 Description   

Summary: lock to webpack v5.69.1

Details: webpack 5.69.0 and 5.70.0 contain a change to "handle multiple alternative directories (e. g. due to resolve.alias or resolve.modules) when creating an context module" that cause resolution problems with moment's locale bundling. I think the relevant issue is #5492 where the author notes that the way the ecosystem has changed with the advent of ESM modules is basically at odds with the way moment handles locales. 

For stripes-smart-components and possibly some others, test output is prefixed with ~7k lines of errors, first like this:

{
    moduleIdentifier: '/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale|/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale|lazy|/(en)/|groupOptions: {}|namespace object',
    moduleName: './node_modules/moment/locale/ ./node_modules/moment/locale/ lazy (en) namespace object',
    loc: 'moment/locale/af',
    message: "Module not found: Error: Can't resolve '/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af' in '/Users/zburke/projects/folio-org/stripes-smart-components'",
    moduleId: './node_modules/moment/locale ./node_modules/moment/locale lazy recursive (en)',
    moduleTrace: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ],
    details: "resolve '/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af' in '/Users/zburke/projects/folio-org/stripes-smart-components'\n" +
      '  using description file: /Users/zburke/projects/folio-org/stripes-smart-components/package.json (relative path: .)\n' +
      "    Field 'browser' doesn't contain a valid alias configuration\n" +
      '    root path /Users/zburke/projects/folio-org/stripes-smart-components\n' +
      '      using description file: /Users/zburke/projects/folio-org/stripes-smart-components/package.json (relative path: ./Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af)\n' +
      '        no extension\n' +
      "          Field 'browser' doesn't contain a valid alias configuration\n" +
      "          /Users/zburke/projects/folio-org/stripes-smart-components/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af doesn't exist\n" +
      '        .js\n' +
      "          Field 'browser' doesn't contain a valid alias configuration\n" +
      "          /Users/zburke/projects/folio-org/stripes-smart-components/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af.js doesn't exist\n" +
      '        .json\n' +
      "          Field 'browser' doesn't contain a valid alias configuration\n" +
      "          /Users/zburke/projects/folio-org/stripes-smart-components/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af.json doesn't exist\n" +
      '        .tsx\n' +
      "          Field 'browser' doesn't contain a valid alias configuration\n" +
      "          /Users/zburke/projects/folio-org/stripes-smart-components/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af.tsx doesn't exist\n" +
      '        css\n' +
      "          Field 'browser' doesn't contain a valid alias configuration\n" +
      "          /Users/zburke/projects/folio-org/stripes-smart-components/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/afcss doesn't exist\n" +
      '        as directory\n' +
      "          /Users/zburke/projects/folio-org/stripes-smart-components/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af doesn't exist\n" +
      '    using description file: /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/package.json (relative path: ./locale/moment/locale/af)\n' +
      '      no extension\n' +
      "        Field 'browser' doesn't contain a valid alias configuration\n" +
      "        /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af doesn't exist\n" +
      '      .js\n' +
      "        Field 'browser' doesn't contain a valid alias configuration\n" +
      "        /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af.js doesn't exist\n" +
      '      .json\n' +
      "        Field 'browser' doesn't contain a valid alias configuration\n" +
      "        /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af.json doesn't exist\n" +
      '      .tsx\n' +
      "        Field 'browser' doesn't contain a valid alias configuration\n" +
      "        /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af.tsx doesn't exist\n" +
      '      css\n' +
      "        Field 'browser' doesn't contain a valid alias configuration\n" +
      "        /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/afcss doesn't exist\n" +
      '      as directory\n' +
      "        /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af doesn't exist",
    stack: "ModuleNotFoundError: Module not found: Error: Can't resolve '/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af' in '/Users/zburke/projects/folio-org/stripes-smart-components'\n" +
      '    at /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/webpack/lib/Compilation.js:2014:28\n' +
      '    at /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/webpack/lib/NormalModuleFactory.js:791:13\n' +
      '    at eval (eval at create (/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)\n' +
      '    at /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/webpack/lib/NormalModuleFactory.js:265:22\n' +
      '    at eval (eval at create (/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\n' +
      '    at /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/webpack/lib/NormalModuleFactory.js:427:22\n' +
      '    at /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/webpack/lib/NormalModuleFactory.js:111:11\n' +
      '    at /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/webpack/lib/NormalModuleFactory.js:663:25\n' +
      '    at /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/webpack/lib/NormalModuleFactory.js:848:8\n' +
      '    at /Users/zburke/projects/folio-org/stripes-smart-components/node_modules/webpack/lib/NormalModuleFactory.js:968:5'
  }, 

and then like this:

WARNING in ./node_modules/moment/locale/ ./node_modules/moment/locale/ lazy (en) namespace object moment/locale/af
Module not found: Error: Can't resolve '/Users/zburke/projects/folio-org/stripes-smart-components/node_modules/moment/locale/moment/locale/af' in '/Users/zburke/projects/folio-org/stripes-smart-components'
 @ ./node_modules/@folio/stripes-core/src/loginServices.js 124:4-49
 @ ./node_modules/@folio/stripes-core/index.js 12:0-75 12:0-75 12:0-75 30:0-55 30:0-55 31:0-64 31:0-64 32:0-55 32:0-55
 @ ./lib/ClipCopy/ClipCopy.js 5:0-53 11:27-41
 @ ./lib/ sync ^(?%21.*(stories%7Cexamples)).*\.js$ ./ClipCopy/ClipCopy.js
 @ ./tests/index.js 10:24-92

once of each for each locale.


Generated at Thu Feb 08 22:14:44 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.