#6341 closed defect (invalid)

Extension build fails if module names differ in mapping

Reported by: greiner Assignee:
Priority: Unknown Milestone:
Module: Automation Keywords:
Cc: kzar, sebastian Blocked By:
Blocking: #6008 Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Environment

Ubuntu 16.04

How to reproduce

  1. Add module lib/prefs.js to adblockplusui
  2. Add mapping lib/ui.js = adblockplusui/lib/prefs.js to adblockpluschrome
  3. Add require("ui") to any file in adblockpluschrome/lib/
  4. Run build.py devenv -t chrome

Observed behaviour

Build fails with error (see below).

Expected behaviour

Build succeeds without errors.
Module names in original repository should be able to differ to avoid naming conflicts.

Errors

.../adblockpluschrome/buildtools/webpack_runner.js:135
      throw new Error(stats.toJson().errors.join("\n"));
      ^

Error: (undefined) ./lib/subscriptionInit.js
Module not found: Error: Can't resolve 'ui' in '.../adblockpluschrome/lib'
resolve 'ui' in '.../adblockpluschrome/lib'
  Parsed request is a module
  No description file found
  resolve as module
    looking for modules in .../adblockpluschrome/lib
      No description file found
      No description file found
      no extension
        .../adblockpluschrome/lib/ui doesn't exist
      .js
        .../adblockpluschrome/lib/ui.js doesn't exist
      .json
        .../adblockpluschrome/lib/ui.json doesn't exist
      as directory
        .../adblockpluschrome/lib/ui doesn't exist
    looking for modules in .../adblockpluschrome/adblockpluscore/lib
      using description file: .../adblockpluschrome/adblockpluscore/package.json (relative path: ./lib)
        Field 'browser' doesn't contain a valid alias configuration
      after using description file: .../adblockpluschrome/adblockpluscore/package.json (relative path: ./lib)
        using description file: .../adblockpluschrome/adblockpluscore/package.json (relative path: ./lib/ui)
          no extension
            Field 'browser' doesn't contain a valid alias configuration
            .../adblockpluschrome/adblockpluscore/lib/ui doesn't exist
          .js
            Field 'browser' doesn't contain a valid alias configuration
            .../adblockpluschrome/adblockpluscore/lib/ui.js doesn't exist
          .json
            Field 'browser' doesn't contain a valid alias configuration
            .../adblockpluschrome/adblockpluscore/lib/ui.json doesn't exist
          as directory
            .../adblockpluschrome/adblockpluscore/lib/ui doesn't exist
    looking for modules in .../adblockpluschrome/adblockplusui/lib
      No description file found
      No description file found
      no extension
        resolved symlink to .../adblockplusui/lib/ui
          No description file found
        after resolved symlink to .../adblockplusui/lib/ui
          no extension
            .../adblockplusui/lib/ui doesn't exist
          .js
            .../adblockplusui/lib/ui.js doesn't exist
          .json
            .../adblockplusui/lib/ui.json doesn't exist
          as directory
            .../adblockplusui/lib/ui doesn't exist
        .../adblockpluschrome/adblockplusui/lib/ui doesn't exist
      .js
        resolved symlink to .../adblockplusui/lib/ui.js
          No description file found
        after resolved symlink to .../adblockplusui/lib/ui.js
          no extension
            .../adblockplusui/lib/ui.js doesn't exist
          .js
            .../adblockplusui/lib/ui.js.js doesn't exist
          .json
            .../adblockplusui/lib/ui.js.json doesn't exist
          as directory
            .../adblockplusui/lib/ui.js doesn't exist
        .../adblockpluschrome/adblockplusui/lib/ui.js doesn't exist
      .json
        resolved symlink to .../adblockplusui/lib/ui.json
          No description file found
        after resolved symlink to .../adblockplusui/lib/ui.json
          no extension
            .../adblockplusui/lib/ui.json doesn't exist
          .js
            .../adblockplusui/lib/ui.json.js doesn't exist
          .json
            .../adblockplusui/lib/ui.json.json doesn't exist
          as directory
            .../adblockplusui/lib/ui.json doesn't exist
        .../adblockpluschrome/adblockplusui/lib/ui.json doesn't exist
      as directory
        .../adblockpluschrome/adblockplusui/lib/ui doesn't exist
[.../adblockpluschrome/lib/package.json]
[.../adblockpluschrome/lib/package.json]
[.../adblockpluschrome/lib/ui/package.json]
[.../adblockpluschrome/lib/ui]
[.../adblockpluschrome/lib/ui.js]
[.../adblockpluschrome/lib/ui.json]
[.../adblockpluschrome/lib/ui]
[.../adblockpluschrome/adblockpluscore/lib/ui]
[.../adblockpluschrome/adblockpluscore/lib/ui.js]
[.../adblockpluschrome/adblockpluscore/lib/ui.json]
[.../adblockpluschrome/adblockpluscore/lib/ui]
[.../adblockpluschrome/adblockplusui/lib/package.json]
[.../adblockpluschrome/adblockplusui/lib/ui/package.json]
[.../adblockplusui/lib/ui/package.json]
[.../adblockplusui/lib/ui]
[.../adblockplusui/lib/ui.js]
[.../adblockplusui/lib/ui.json]
[.../adblockplusui/lib/ui]
[.../adblockpluschrome/adblockplusui/lib/ui]
[.../adblockplusui/lib/ui.js/package.json]
[.../adblockplusui/lib/ui.js]
[.../adblockplusui/lib/ui.js.js]
[.../adblockplusui/lib/ui.js.json]
[.../adblockplusui/lib/ui.js]
[.../adblockpluschrome/adblockplusui/lib/ui.js]
[.../adblockplusui/lib/ui.json/package.json]
[.../adblockplusui/lib/ui.json]
[.../adblockplusui/lib/ui.json.js]
[.../adblockplusui/lib/ui.json.json]
[.../adblockplusui/lib/ui.json]
[.../adblockpluschrome/adblockplusui/lib/ui.json]
[.../adblockpluschrome/adblockplusui/lib/ui]
 @ ./lib/subscriptionInit.js 31:25-38
 @ multi ./adblockpluscore/lib/filterListener.js ./adblockpluscore/lib/synchronizer.js ./lib/requestBlocker.js ./lib/popupBlocker.js ./lib/subscriptionInit.js ./lib/filterComposer.js ./lib/stats.js ./lib/uninstall.js ./lib/csp.js ./lib/cssInjection.js ./adblockplusui/messageResponder.js ./background.js
    at webpackCompiler.run (.../adblockpluschrome/buildtools/webpack_runner.js:135:13)
    at runWithDependencies (.../adblockpluschrome/buildtools/node_modules/webpack/lib/MultiCompiler.js:154:4)
    at .../adblockpluschrome/buildtools/node_modules/async/dist/async.js:1126:9
    at .../adblockpluschrome/buildtools/node_modules/async/dist/async.js:473:16
    at iteratorCallback (.../adblockpluschrome/buildtools/node_modules/async/dist/async.js:1050:13)
    at .../adblockpluschrome/buildtools/node_modules/async/dist/async.js:958:16
    at .../adblockpluschrome/buildtools/node_modules/async/dist/async.js:1123:13
    at runCompilers (.../adblockpluschrome/buildtools/node_modules/webpack/lib/MultiCompiler.js:96:47)
    at fn (.../adblockpluschrome/buildtools/node_modules/webpack/lib/MultiCompiler.js:101:6)
    at compiler.run (.../adblockpluschrome/buildtools/node_modules/webpack/lib/MultiCompiler.js:150:5)
Traceback (most recent call last):
  File "./build.py", line 18, in <module>
    buildtools.build.process_args(BASE_DIR)
  File ".../adblockpluschrome/buildtools/build.py", line 388, in process_args
    function(**vars(arguments))
  File ".../adblockpluschrome/buildtools/build.py", line 181, in devenv
    releaseBuild=True)
  File ".../adblockpluschrome/buildtools/packagerChrome.py", line 379, in createBuild
    create_bundles(params, files, bundle_tests)
  File ".../adblockpluschrome/buildtools/packagerChrome.py", line 213, in create_bundles
    raise subprocess.CalledProcessError(process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['node', '.../adblockpluschrome/buildtools/webpack_runner.js']' returned non-zero exit status 1

Change History (3)

comment:1 Changed 22 months ago by greiner

  • Blocking 6008 added

comment:2 follow-up: Changed 22 months ago by kzar

Try undoing your metadata changes and then requiring the module like require ("../adblockplusui/lib/prefs") instead. WebPack resolves and bundles the modules automatically now.

Last edited 22 months ago by kzar (previous) (diff)

comment:3 in reply to: ↑ 2 Changed 22 months ago by greiner

  • Resolution set to invalid
  • Status changed from new to closed

Replying to kzar:

Try undoing your metadata changes and then requiring the module like require ("../adblockplusui/lib/prefs") instead. WebPack resolves and bundles the modules automatically now.

Thanks, that works.

Note: See TracTickets for help on using tickets.