kimroen / ember-cli-coffeescript

Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command.
MIT License
72 stars 49 forks source link

Broccoli Plugin: [CoffeeScriptFilter] failed with: Error: EEXIST: file already exists #107

Closed andrewhavens closed 8 years ago

andrewhavens commented 8 years ago

I'm trying to install ember-simple-auth and am running into this error:

Build failed.
The Broccoli Plugin: [CoffeeScriptFilter] failed with:
Error: EEXIST: file already exists, symlink '/Users/andrew/myapp/node_modules/ember-simple-auth/app/routes/application.js' -> '/Users/andrew/myapp/tmp/coffee_script_filter-output_path-WVUVSh66.tmp/myapp/routes/application.js'
  at Error (native)
  at Object.fs.symlinkSync (fs.js:945:18)
  at symlink (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/symlink-or-copy/index.js:82:14)
  at symlinkOrCopySync (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/symlink-or-copy/index.js:58:5)
  at rebuildEntry (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/index.js:72:9)
  at /Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/promise-map-series/index.js:11:14
  at lib$rsvp$$internal$$tryCatch (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:1036:16)
  at lib$rsvp$$internal$$invokeCallback (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:1048:17)
  at lib$rsvp$$internal$$publish (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:1019:11)
  at lib$rsvp$asap$$flush (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:1198:9)
  at nextTickCallbackWith0Args (node.js:452:9)
  at process._tickCallback (node.js:381:13)

The broccoli plugin was instantiated at: 
  at CoffeeScriptFilter.Plugin (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/node_modules/broccoli-plugin/index.js:7:31)
  at CoffeeScriptFilter.Filter [as constructor] (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/node_modules/broccoli-filter/index.js:34:10)
  at new CoffeeScriptFilter (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/index.js:9:10)
  at CoffeeScriptFilter (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/node_modules/broccoli-coffee/index.js:8:53)
  at CoffeePreprocessor.toTree (/Users/andrew/myapp/node_modules/ember-cli-coffeescript/lib/coffee-preprocessor.js:23:10)
  at /Users/andrew/myapp/node_modules/ember-cli/node_modules/ember-cli-preprocess-registry/preprocessors.js:184:26
  at Array.forEach (native)
  at processPlugins (/Users/andrew/myapp/node_modules/ember-cli/node_modules/ember-cli-preprocess-registry/preprocessors.js:182:11)
  at module.exports.preprocessJs (/Users/andrew/myapp/node_modules/ember-cli/node_modules/ember-cli-preprocess-registry/preprocessors.js:175:10)
  at EmberApp.appAndDependencies (/Users/andrew/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:1044:25)
  at EmberApp.javascript (/Users/andrew/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:1159:34)
  at EmberApp.toArray (/Users/andrew/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:1564:10)
  at EmberApp.toTree (/Users/andrew/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:1586:30)
  at module.exports (/Users/andrew/myapp/ember-cli-build.js:23:14)
  at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/andrew/myapp/node_modules/ember-cli/lib/models/builder.js:55:19)
  at Class.module.exports.Task.extend.init (/Users/andrew/myapp/node_modules/ember-cli/lib/models/builder.js:89:10)
  at new Class (/Users/andrew/myapp/node_modules/ember-cli/node_modules/core-object/core-object.js:18:12)
  at Class.module.exports.Task.extend.run (/Users/andrew/myapp/node_modules/ember-cli/lib/tasks/build.js:15:19)
  at /Users/andrew/myapp/node_modules/ember-cli/lib/commands/build.js:32:24
  at lib$rsvp$$internal$$tryCatch (/Users/andrew/myapp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
  at lib$rsvp$$internal$$invokeCallback (/Users/andrew/myapp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
  at /Users/andrew/myapp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:331:11
  at lib$rsvp$asap$$flush (/Users/andrew/myapp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
  at nextTickCallbackWith0Args (node.js:452:9)
  at process._tickCallback (node.js:381:13)

I am new to Ember CLI. What do I need to do to fix this issue?

andrewhavens commented 8 years ago

Ah, looks like this issue has already been filed before. Turns out the error has to do with a conflict between the default routes/application.js provided by ember-simple-auth and our app's routes/application.coffee. The solution is to convert our routes/application.coffee back to JavaScript.

Duplicate: https://github.com/kimroen/ember-cli-coffeescript/issues/92 Originally filed with ember-simple-auth: https://github.com/simplabs/ember-simple-auth/issues/659

According to @marcoow of ember-simple-auth:

Seems like ember-cli-coffeescript doesn't really work with Ember CLI's way of having addons merge stuff into the application.

...so maybe this is still an issue that needs to be resolved?

jrr commented 8 years ago

@andrewhavens alternatively, if you want to keep your coffee, you can delete ESA's routes/application.js: https://github.com/simplabs/ember-simple-auth/issues/851#issuecomment-205623700

kimroen commented 8 years ago

As you've noted, this has been reported before, and I've tried to outline the possible solutions over in this issue: #87

Closing this, but please do come with input in that issue if you have thoughts or could help out with moving in the direction of one of the proposed solutions.

yaxinr commented 5 years ago

my solution app\routes\app-route-mixin.coffee

export default Mixin.create()

app\routes\application.js

import AppRouteMixin from './app-route-mixin';

export default Route.extend(AppRouteMixin)