Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BroccoliMergeTrees] error while merging the following #169

Closed
piotrpalek opened this issue May 12, 2019 · 9 comments
Closed

[BroccoliMergeTrees] error while merging the following #169

piotrpalek opened this issue May 12, 2019 · 9 comments

Comments

@piotrpalek
Copy link

Hey, I've followed the instructions and tried to run my app, but got the following error. Any ideas what the issue might be?

=================================================================================

ENV Summary:

  TIME: Sun May 12 2019 16:41:03 GMT+0200 (CEST)
  TITLE: ember
  ARGV:
  - /Users/user/.nvm/versions/node/v8.9.1/bin/node
  - /Users/user/.nvm/versions/node/v8.9.1/bin/ember
  - s
  EXEC_PATH: /Users/user/.nvm/versions/node/v8.9.1/bin/node
  TMPDIR: /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T
  SHELL: /bin/zsh
  PATH:
  - /Users/user/.nvm/versions/node/v8.9.1/bin
  - /usr/local/bin
  - /usr/bin
  - /bin
  - /usr/sbin
  - /sbin
  - /Users/user/.nvm/versions/node/v8.9.1/bin
  - /Users/user/go/bin
  - /Users/user/go/bin
  PLATFORM: darwin x64
  FREEMEM: 2964840448
  TOTALMEM: 17179869184
  UPTIME: 175864
  LOADAVG: 2.263671875,1.9599609375,1.9169921875
  CPUS:
  - Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz - 2800
  - Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz - 2800
  - Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz - 2800
  - Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz - 2800
  - Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz - 2800
  - Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz - 2800
  - Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz - 2800
  - Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz - 2800
  ENDIANNESS: LE
  VERSIONS:
  - ares: 1.10.1-DEV
  - cldr: 31.0.1
  - http_parser: 2.7.0
  - icu: 59.1
  - modules: 57
  - nghttp2: 1.25.0
  - node: 8.9.1
  - openssl: 1.0.2m
  - tz: 2017b
  - unicode: 9.0
  - uv: 1.15.0
  - v8: 6.1.534.47
  - zlib: 1.2.11

ERROR Summary:

  - broccoliBuilderErrorStack: Error: [BroccoliMergeTrees] error while merging the following:
  1.  [ObserveTree: @embroider/compat/observe-tree]
  2.  [ObserveTree: @embroider/compat/observe-tree]
  3.  [ObserveTree: @embroider/compat/observe-tree]
  4.  [Funnel]
  5.  [RewritePackageJSON: embroider:core:rewrite-package-json]
Merge error: file app.css exists in /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-23-observe_tree_embroider_compat_observe_tree and /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-27-observe_tree_embroider_compat_observe_tree
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
    at MergeTrees._getMergedDirectory2 (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/node_modules/merge-trees/index.js:151:19)
    at MergeTrees._getMergedDirectory (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/node_modules/merge-trees/index.js:40:17)
    at MergeTrees.merge (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/node_modules/merge-trees/index.js:27:20)
    at BroccoliMergeTrees.build (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:36:21)
    at resolve (/Users/user/dev/testapp/node_modules/broccoli/lib/wrappers/transform-node.js:29:35)
    at new Promise (<anonymous>)
    at TransformNodeWrapper.build (/Users/user/dev/testapp/node_modules/broccoli/lib/wrappers/transform-node.js:21:12)
    at Promise.resolve.then.then.then (/Users/user/dev/testapp/node_modules/broccoli/lib/builder.js:116:28)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
  - code: [undefined]
  - codeFrame: [BroccoliMergeTrees] error while merging the following:
  1.  [ObserveTree: @embroider/compat/observe-tree]
  2.  [ObserveTree: @embroider/compat/observe-tree]
  3.  [ObserveTree: @embroider/compat/observe-tree]
  4.  [Funnel]
  5.  [RewritePackageJSON: embroider:core:rewrite-package-json]
Merge error: file app.css exists in /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-23-observe_tree_embroider_compat_observe_tree and /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-27-observe_tree_embroider_compat_observe_tree
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
        at BroccoliMergeTrees
-~- created here: -~-
    at BroccoliMergeTrees.Plugin (/Users/user/dev/testapp/node_modules/broccoli-plugin/index.js:7:31)
    at new BroccoliMergeTrees (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:16:10)
    at Object.BroccoliMergeTrees [as default] (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:10:53)
    at V1Addon.get v2Tree [as v2Tree] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/v1-addon.js:298:46)
    at oldPackages.map.pkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:42:48)
    at Array.map (<anonymous>)
    at buildCompatAddon (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:42:33)
    at Object.cachedBuildCompatAddon [as default] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:13:16)
    at CompatAddons.movedAddons.map.oldPkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/compat-addons.js:39:105)
    at Array.map (<anonymous>)
-~- (end) -~-
  - errorMessage: [BroccoliMergeTrees] error while merging the following:
  1.  [ObserveTree: @embroider/compat/observe-tree]
  2.  [ObserveTree: @embroider/compat/observe-tree]
  3.  [ObserveTree: @embroider/compat/observe-tree]
  4.  [Funnel]
  5.  [RewritePackageJSON: embroider:core:rewrite-package-json]
Merge error: file app.css exists in /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-23-observe_tree_embroider_compat_observe_tree and /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-27-observe_tree_embroider_compat_observe_tree
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
        at BroccoliMergeTrees
-~- created here: -~-
    at BroccoliMergeTrees.Plugin (/Users/user/dev/testapp/node_modules/broccoli-plugin/index.js:7:31)
    at new BroccoliMergeTrees (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:16:10)
    at Object.BroccoliMergeTrees [as default] (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:10:53)
    at V1Addon.get v2Tree [as v2Tree] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/v1-addon.js:298:46)
    at oldPackages.map.pkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:42:48)
    at Array.map (<anonymous>)
    at buildCompatAddon (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:42:33)
    at Object.cachedBuildCompatAddon [as default] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:13:16)
    at CompatAddons.movedAddons.map.oldPkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/compat-addons.js:39:105)
    at Array.map (<anonymous>)
-~- (end) -~-
        at OneShot
-~- created here: -~-
    at new Plugin (/Users/user/dev/testapp/node_modules/broccoli-plugin/index.js:7:31)
    at new OneShot (/Users/user/dev/testapp/node_modules/@embroider/compat/src/one-shot.js:14:9)
    at Object.cachedBuildCompatAddon [as default] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:15:16)
    at CompatAddons.movedAddons.map.oldPkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/compat-addons.js:39:105)
    at Array.map (<anonymous>)
    at new CompatAddons (/Users/user/dev/testapp/node_modules/@embroider/compat/src/compat-addons.js:39:63)
    at Object.defaultPipeline [as compatBuild] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/default-pipeline.js:17:18)
    at module.exports (/Users/user/dev/testapp/ember-cli-build.js:32:39)
    at Builder.readBuildFile (/Users/user/dev/testapp/node_modules/ember-cli/lib/models/builder.js:52:14)
    at Builder.setupBroccoliBuilder (/Users/user/dev/testapp/node_modules/ember-cli/lib/models/builder.js:66:22)
-~- (end) -~-
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
    - treeDir: [undefined]
  - message: [BroccoliMergeTrees] error while merging the following:
  1.  [ObserveTree: @embroider/compat/observe-tree]
  2.  [ObserveTree: @embroider/compat/observe-tree]
  3.  [ObserveTree: @embroider/compat/observe-tree]
  4.  [Funnel]
  5.  [RewritePackageJSON: embroider:core:rewrite-package-json]
Merge error: file app.css exists in /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-23-observe_tree_embroider_compat_observe_tree and /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-27-observe_tree_embroider_compat_observe_tree
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
        at BroccoliMergeTrees
-~- created here: -~-
    at BroccoliMergeTrees.Plugin (/Users/user/dev/testapp/node_modules/broccoli-plugin/index.js:7:31)
    at new BroccoliMergeTrees (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:16:10)
    at Object.BroccoliMergeTrees [as default] (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:10:53)
    at V1Addon.get v2Tree [as v2Tree] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/v1-addon.js:298:46)
    at oldPackages.map.pkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:42:48)
    at Array.map (<anonymous>)
    at buildCompatAddon (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:42:33)
    at Object.cachedBuildCompatAddon [as default] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:13:16)
    at CompatAddons.movedAddons.map.oldPkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/compat-addons.js:39:105)
    at Array.map (<anonymous>)
-~- (end) -~-
        at OneShot
-~- created here: -~-
    at new Plugin (/Users/user/dev/testapp/node_modules/broccoli-plugin/index.js:7:31)
    at new OneShot (/Users/user/dev/testapp/node_modules/@embroider/compat/src/one-shot.js:14:9)
    at Object.cachedBuildCompatAddon [as default] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:15:16)
    at CompatAddons.movedAddons.map.oldPkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/compat-addons.js:39:105)
    at Array.map (<anonymous>)
    at new CompatAddons (/Users/user/dev/testapp/node_modules/@embroider/compat/src/compat-addons.js:39:63)
    at Object.defaultPipeline [as compatBuild] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/default-pipeline.js:17:18)
    at module.exports (/Users/user/dev/testapp/ember-cli-build.js:32:39)
    at Builder.readBuildFile (/Users/user/dev/testapp/node_modules/ember-cli/lib/models/builder.js:52:14)
    at Builder.setupBroccoliBuilder (/Users/user/dev/testapp/node_modules/ember-cli/lib/models/builder.js:66:22)
-~- (end) -~-
  - name: BuildError
  - nodeAnnotation: [undefined]
  - nodeName: OneShot
  - originalErrorMessage: [BroccoliMergeTrees] error while merging the following:
  1.  [ObserveTree: @embroider/compat/observe-tree]
  2.  [ObserveTree: @embroider/compat/observe-tree]
  3.  [ObserveTree: @embroider/compat/observe-tree]
  4.  [Funnel]
  5.  [RewritePackageJSON: embroider:core:rewrite-package-json]
Merge error: file app.css exists in /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-23-observe_tree_embroider_compat_observe_tree and /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-27-observe_tree_embroider_compat_observe_tree
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
        at BroccoliMergeTrees
-~- created here: -~-
    at BroccoliMergeTrees.Plugin (/Users/user/dev/testapp/node_modules/broccoli-plugin/index.js:7:31)
    at new BroccoliMergeTrees (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:16:10)
    at Object.BroccoliMergeTrees [as default] (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:10:53)
    at V1Addon.get v2Tree [as v2Tree] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/v1-addon.js:298:46)
    at oldPackages.map.pkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:42:48)
    at Array.map (<anonymous>)
    at buildCompatAddon (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:42:33)
    at Object.cachedBuildCompatAddon [as default] (/Users/user/dev/testapp/node_modules/@embroider/compat/src/build-compat-addon.js:13:16)
    at CompatAddons.movedAddons.map.oldPkg (/Users/user/dev/testapp/node_modules/@embroider/compat/src/compat-addons.js:39:105)
    at Array.map (<anonymous>)
-~- (end) -~-
  - stack: Error: [BroccoliMergeTrees] error while merging the following:
  1.  [ObserveTree: @embroider/compat/observe-tree]
  2.  [ObserveTree: @embroider/compat/observe-tree]
  3.  [ObserveTree: @embroider/compat/observe-tree]
  4.  [Funnel]
  5.  [RewritePackageJSON: embroider:core:rewrite-package-json]
Merge error: file app.css exists in /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-23-observe_tree_embroider_compat_observe_tree and /var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/broccoli-34151OyagRZf6r1Fl/out-27-observe_tree_embroider_compat_observe_tree
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
    at MergeTrees._getMergedDirectory2 (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/node_modules/merge-trees/index.js:151:19)
    at MergeTrees._getMergedDirectory (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/node_modules/merge-trees/index.js:40:17)
    at MergeTrees.merge (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/node_modules/merge-trees/index.js:27:20)
    at BroccoliMergeTrees.build (/Users/user/dev/testapp/node_modules/broccoli-merge-trees/index.js:36:21)
    at resolve (/Users/user/dev/testapp/node_modules/broccoli/lib/wrappers/transform-node.js:29:35)
    at new Promise (<anonymous>)
    at TransformNodeWrapper.build (/Users/user/dev/testapp/node_modules/broccoli/lib/wrappers/transform-node.js:21:12)
    at Promise.resolve.then.then.then (/Users/user/dev/testapp/node_modules/broccoli/lib/builder.js:116:28)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

=================================================================================
@ef4
Copy link
Contributor

ef4 commented May 12, 2019 via email

@piotrpalek
Copy link
Author

piotrpalek commented May 12, 2019

Yes, sass (although I tried removing it and the addon from package-json and the error seems the same). Here is my package.json:

{
  "name": "app",
  "version": "0.0.0",
  "private": true,
  "description": "Small description for app goes here",
  "repository": "",
  "license": "MIT",
  "author": "",
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "build": "ember build",
    "lint:js": "eslint .",
    "start": "ember serve",
    "test": "ember test"
  },
  "devDependencies": {
    "@babel/plugin-proposal-object-rest-spread": "^7.4.4",
    "@ember/jquery": "^0.6.0",
    "@ember/optional-features": "^0.6.3",
    "@embroider/compat": "^0.3.5",
    "@embroider/core": "^0.3.5",
    "@embroider/webpack": "^0.3.5",
    "@html-next/vertical-collection": "^1.0.0-beta.12",
    "broccoli-asset-rev": "^3.0.0",
    "ember-ajax": "^5.0.0",
    "ember-auto-import": "^1.3.0",
    "ember-autoresize": "^1.2.1",
    "ember-cli": "~3.9.0",
    "ember-cli-app-version": "^3.2.0",
    "ember-cli-babel": "^7.1.2",
    "ember-cli-dependency-checker": "^3.1.0",
    "ember-cli-deploy": "^1.0.2",
    "ember-cli-deploy-build": "^1.1.1",
    "ember-cli-deploy-display-revisions": "^1.0.0",
    "ember-cli-deploy-gzip": "^1.0.1",
    "ember-cli-deploy-manifest": "^1.1.0",
    "ember-cli-deploy-revision-data": "^1.0.0",
    "ember-cli-deploy-s3": "^1.4.0",
    "ember-cli-deploy-s3-index": "^1.0.1",
    "ember-cli-eslint": "^4.2.3",
    "ember-cli-htmlbars": "^3.0.0",
    "ember-cli-htmlbars-inline-precompile": "^1.0.3",
    "ember-cli-inject-live-reload": "^1.8.2",
    "ember-cli-sass": "^10.0.0",
    "ember-cli-uglify": "^2.1.0",
    "ember-cli-update": "^0.34.5",
    "ember-composable-helpers": "^2.1.0",
    "ember-concurrency": "^0.8.17",
    "ember-export-application-global": "^2.0.0",
    "ember-fetch": "^6.5.1",
    "ember-flatpickr": "^2.14.0",
    "ember-href-to": "^1.15.1",
    "ember-in-viewport": "^3.0.3",
    "ember-load-initializers": "^1.1.0",
    "ember-paper": "1.0.0-beta.24",
    "ember-qunit": "^3.4.1",
    "ember-resolver": "^5.0.1",
    "ember-source": "~3.9.0",
    "ember-truth-helpers": "^2.0.0",
    "ember-wormhole": "^0.5.4",
    "eslint-plugin-ember": "^5.2.0",
    "firebase": "^5.10.0",
    "firebaseui": "^3.5.2",
    "inobounce": "^0.1.6",
    "loader.js": "^4.7.0",
    "luxon": "^1.12.1",
    "qunit-dom": "^0.8.0",
    "sass": "^1.20.1",
    "torii": "^0.10.1"
  },
  "peerDependencies": {
    "@babel/core": "^7.4.3"
  }
}

@piotrpalek
Copy link
Author

The problematic package seems to be "@html-next/vertical-collection": "^1.0.0-beta.12". Upgrading it to beta.13 does not fix the issue.
When I remove the package from package.json I get another error:

Module not found: Error: Can't resolve './initializers/initialize-torii' in '/private/var/folders/3_/j1n1p4dn6gx884nt498fg9040000gn/T/embroider/657b0b/node_modules/torii'

@ef4
Copy link
Contributor

ef4 commented May 13, 2019

The source of the error while merging is that vertical-collection's custom treeForAddon emits a CSS file. It shouldn't.

IMO the entire treeForAddon in vertical-collection is trying too hard to be clever and should be scrapped. Using Rollup here actively subverts our ability to analyze and optimize.

You can workaround by neutering the entire custom treeForAddon hook like this:

const { V1Addon } = require('@embroider/compat');
const Webpack = require('@embroider/webpack').Webpack;
return require('@embroider/compat').compatBuild(app, Webpack, {
  compatAdapters: new Map([[
    "@html-next/vertical-collection",
    class extends V1Addon {
      customizes(...names) {
        // this causes us to never detect a customized treeForAddon and therefore never run it.
        // the treeForAddon in this package does dubious things, and we end up more correct
        // without it.
        return super.customizes(...names.filter(n => n !== 'treeForAddon'));
      }
    }
  ]])
});

The torii issue is unrelated but I made a PR to fix that too.

@piotrpalek
Copy link
Author

@ef4 this is great, thanks! So something like this:

  const { V1Addon } = require('@embroider/compat');
  const Webpack = require('@embroider/webpack').Webpack;
  const Funnel = require('broccoli-funnel');
  let compatAdapters = new Map();
  compatAdapters.set('torii', class extends V1Addon {
    get v2Tree() {
      let tree = super.v2Tree;
      return new Funnel(tree, {
        exclude: ['addon/load-initializers.js']
      });
    }
  });

should fix the torii issue locally right? I'm weirdly not getting it anymore though.

@ef4
Copy link
Contributor

ef4 commented May 14, 2019

If you happened to enable staticAddonTrees: true that would make the torii problem go away.

That compat adapter is close to the right idea, but this code is running after converting it to v2 format, so addon/load-initializers.js has already been moved to load-initializers.js.

But also, the reason we're including load-initializers.js in the app at all is due to the default staticAddonTrees: false setting, which finds all the files in the addon tree and lists them in the addon's ember-addon.implicit-modules in package.json. That entry will still be present if you filter out the file, leading to an error.

So the cleanest workaround is to remove the entry from implicit-modules instead (and it doesn't matter whether you leave the actual file, as nothing should use it anyway). Here's an example of a compat adapter that removes an entry from implicit-modules:

get packageMeta(): Partial<AddonMeta> {
let meta = super.packageMeta;
if (isProductionEnv() && !isInstrumentedBuild()) {
meta = cloneDeep(meta);
if (meta['implicit-modules']) {
meta['implicit-modules'] = meta['implicit-modules'].filter(name => !name.startsWith('./-debug/'));
}
}
return meta;
}

@piotrpalek
Copy link
Author

Thanks, I had an additional issue with ember-paper, but I was able to resolve it (I'll try to make a PR later).

Here is the full code for my local compat-adapters that I've used:

  const { V1Addon } = require('@embroider/compat');
  const Webpack = require('@embroider/webpack').Webpack;
  let compatAdapters = new Map();
  compatAdapters.set('@html-next/vertical-collection', class extends V1Addon {
    customizes(...names) {
      // this causes us to never detect a customized treeForAddon and therefore never run it.
      // the treeForAddon in this package does dubious things, and we end up more correct
      // without it.
      return super.customizes(...names.filter(n => n !== 'treeForAddon'));
    }
  });

  const cloneDeep = require('lodash/cloneDeep');
  compatAdapters.set('torii', class extends V1Addon {
    get packageMeta() {
      let meta = super.packageMeta;
      meta = cloneDeep(meta);

      if (meta['implicit-modules']) {
        meta['implicit-modules'] = meta['implicit-modules'].filter(name =>  !name.startsWith('./load-initializers'));
      }

      return meta;
   }
  });

  const Funnel = require('broccoli-funnel');
  compatAdapters.set('ember-paper', class extends V1Addon {
    get v2Tree() {
      let tree = super.v2Tree;
      return new Funnel(tree, {
        exclude: ['**/paper-autocomplete-dropdown.js', '**/paper-snackbar-text.js']
      });
    }
  });

@piotrpalek
Copy link
Author

Sorry to spam on a closed issue. I have one last question. After building I've got these warnings:

WARNING in ./node_modules/@ember/test-helpers/ember-test-helpers/wait.js 1:0-116
"export '_setupPromiseListeners' was not found in '../settled'
 @ ./assets/test.js

WARNING in ./node_modules/@ember/test-helpers/ember-test-helpers/wait.js 1:0-116
"export '_teardownPromiseListeners' was not found in '../settled'
 @ ./assets/test.js

WARNING in ./helpers/not-eq.js 1:0-71
"export 'notEq' was not found in 'ember-truth-helpers/helpers/not-equal'
 @ ./assets/test-app.js
warning: in index.html <script src="ember-cli-live-reload.js"> does not exist on disk. If this is intentional, use a data-embroider-ignore attribute.
warning: in tests/index.html <script src="ember-cli-live-reload.js"> does not exist on disk. If this is intentional, use a data-embroider-ignore attribute.
warning: in tests/index.html <script src="testem.js"> does not exist on disk. If this is intentional, use a data-embroider-ignore attribute.

I assume these are also related to non-existing imports/exports?

@ef4
Copy link
Contributor

ef4 commented May 15, 2019

Yes, those warnings are pointing out real problems where addons are trying to import nonexistent things. They are warnings and not errors because nobody is actually trying to use the nonexistent things.

It would be very helpful if someone wants to make PRs to those projects to clean up the warnings. It looks like the test-helpers one was already done here: emberjs/ember-test-helpers#580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants