{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/5336","repository_url":"https://api.github.com/repos/ember-cli/ember-cli","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/5336/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/5336/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/5336/events","html_url":"https://github.com/ember-cli/ember-cli/issues/5336","id":126275639,"number":5336,"title":"Unable to override addon re-exports in the consumer application","user":{"login":"ro0gr","id":875361,"avatar_url":"https://avatars.githubusercontent.com/u/875361?v=3","gravatar_id":"","url":"https://api.github.com/users/ro0gr","html_url":"https://github.com/ro0gr","followers_url":"https://api.github.com/users/ro0gr/followers","following_url":"https://api.github.com/users/ro0gr/following{/other_user}","gists_url":"https://api.github.com/users/ro0gr/gists{/gist_id}","starred_url":"https://api.github.com/users/ro0gr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ro0gr/subscriptions","organizations_url":"https://api.github.com/users/ro0gr/orgs","repos_url":"https://api.github.com/users/ro0gr/repos","events_url":"https://api.github.com/users/ro0gr/events{/privacy}","received_events_url":"https://api.github.com/users/ro0gr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ember-cli/ember-cli/labels/Needs%20Bug%20Verification","name":"Needs Bug Verification","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-12T21:07:02Z","updated_at":"2016-02-24T02:04:29Z","closed_at":null,"body":"[repo](https://github.com/beatle/emcli-templates-collision-repro) with reproduction.\r\n\r\nCurrently we develop an addon which shares some layout logic and markup for consumer addons and applications. Following the principles of ember-cli we are trying to keep templates in the addon/templates directory and bridge it via app/templates folder.\r\n\r\nIt works fine until we try to override bridged template in the consumer application.\r\n\r\n```\r\n$ ember g route test\r\n$ ember g template test --dummy\r\n```\r\n\r\nproduces following files:\r\n- addon/routes/test.js\r\n- addon/templates/test.hbs\r\n- tests/unit/routes/test-test.js\r\n- app/routes/test.js\r\n- app/templates/test.js\r\n- tests/dummy/app/templates/test.hbs\r\n\r\nAfter these steps\r\n```\r\nember build\r\n```\r\nfails with error:\r\n```\r\nEEXIST, file already exists '/home/beatle/workspace/ember-cli-apps/c/tmp/template_compiler-output_path-beowNp4d.tmp/dummy/templates/test.js'\r\nError: EEXIST, file already exists '/home/beatle/workspace/ember-cli-apps/c/tmp/template_compiler-output_path-beowNp4d.tmp/dummy/templates/test.js'\r\n    at Error (native)\r\n    at Object.fs.symlinkSync (fs.js:848:18)\r\n    at symlink (/home/beatle/workspace/ember-cli-apps/c/node_modules/symlink-or-copy/index.js:82:14)\r\n    at symlinkOrCopySync (/home/beatle/workspace/ember-cli-apps/c/node_modules/symlink-or-copy/index.js:58:5)\r\n    at TemplateCompiler.Filter._handleFile (/home/beatle/workspace/ember-cli-apps/c/node_modules/broccoli-persistent-filter/index.js:101:12)\r\n    at TemplateCompiler.<anonymous> (/home/beatle/workspace/ember-cli-apps/c/node_modules/broccoli-persistent-filter/index.js:88:21)\r\n    at /home/beatle/workspace/ember-cli-apps/c/node_modules/promise-map-series/index.js:11:14\r\n    at lib$rsvp$$internal$$tryCatch (/home/beatle/workspace/ember-cli-apps/c/node_modules/rsvp/dist/rsvp.js:493:16)\r\n    at lib$rsvp$$internal$$invokeCallback (/home/beatle/workspace/ember-cli-apps/c/node_modules/rsvp/dist/rsvp.js:505:17)\r\n    at lib$rsvp$$internal$$publish (/home/beatle/workspace/ember-cli-apps/c/node_modules/rsvp/dist/rsvp.js:476:11)\r\n```\r\n\r\nAs I can see after some debugging it happens when broccoli tries to save compiled `tests/dummy/app/templates/test.hbs` to the `tests/dummy/app/templates/test.js` where the `app/templates/test.js` is merged already.\r\nA little bit strange but this error happens only on cold starts and works ok on rebuilds(probably because broccoli attempts to `change` just generated `test.js` instead of `create`?).\r\n\r\nAlso it doesn't look like a regression. I've noticed this behaviour earlier(starting from ember-cli@0.2.7) but didn't keep attention on it :see_no_evil: :hear_no_evil: :speak_no_evil: \r\n\r\nLooks like it's an `ember-cli` responsibility to filter bridge files if overrides on the top level exists. But I couldn't find such API in the [broccoli-merge-tree](https://github.com/broccolijs/broccoli-merge-trees). So at this moment I'm not sure whose fault it is.\r\nI'd like to have any guidance on how to deal with such kind of issue. Possibly I'm missing something...\r\n\r\nThank you in advance!\r\n"},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/188011910","html_url":"https://github.com/ember-cli/ember-cli/issues/5336#issuecomment-188011910","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/5336","id":188011910,"user":{"login":"locks","id":32344,"avatar_url":"https://avatars.githubusercontent.com/u/32344?v=3","gravatar_id":"","url":"https://api.github.com/users/locks","html_url":"https://github.com/locks","followers_url":"https://api.github.com/users/locks/followers","following_url":"https://api.github.com/users/locks/following{/other_user}","gists_url":"https://api.github.com/users/locks/gists{/gist_id}","starred_url":"https://api.github.com/users/locks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/locks/subscriptions","organizations_url":"https://api.github.com/users/locks/orgs","repos_url":"https://api.github.com/users/locks/repos","events_url":"https://api.github.com/users/locks/events{/privacy}","received_events_url":"https://api.github.com/users/locks/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T02:04:29Z","updated_at":"2016-02-24T02:04:29Z","body":"I'm also getting this for the application template in https://github.com/locks/ember-welcome-page."}}