问题
I just started using Ember. The next step in the Ember Quickstart tutorial is adding a JS file to a component:
In addition to the template, a component can also have a JavaScript file [...]. Go ahead and create a .js file with the same name and in the same directory as our template (app/components/people-list.js), and paste in the following content:
I did that, but now I get a build error:
Build Error (broccoli-persistent-filter:TemplateCompiler)
EEXIST: file already exists, symlink '/var/folders/9f/hkp3jgh507ld849g376t8v9c0000gp/T/broccoli-68910fD325sz6drb3/out-131-broccoli_merge_trees_templates/ember-quickstart/templates/components/people-list.js' -> '/var/folders/9f/hkp3jgh507ld849g376t8v9c0000gp/T/broccoli-68910fD325sz6drb3/out-132-broccoli_persistent_filter_template_compiler/ember-quickstart/templates/components/people-list.js'
How do I get rid of this?
回答1:
If I'm reading the error message correctly both you people-list.hbs
and people-list.js
files are in app/templates/components
. In Ember Octane both files should be moved to app/components
which is a new feature called component template colocation.
If that isn't the issue you may just need to restart the local ember server (though I haven't had to do that when adding a new js
file for a component in the past.
来源:https://stackoverflow.com/questions/61776823/ember-quickstart-build-error-when-adding-js-file-to-component