awwester
awwester

Reputation: 10182

Ember server error with http mock

Hey I'm new to Ember and having an issue with setting up ember to use the http mock server.

My application before running ember g http-mock developers was working fine, although it is very basic with just a few routes/templates/models/controllers.

I set up my adapter, model, controller and then successfully create the mock server. When trying to restart ember with ember serve I get a strange error and I have no clue how to debug it, and google isn't helping.

Edit - This error is occurring even on a new project. When I type ember new blog, cd blog, ember g http-mock developers I get this same error when trying to start the server? Am I missing something very obvious? Wish the error told me something useful?!

Serving on http://localhost:4200/
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: watch EMFILE
    at exports._errnoException (util.js:746:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1161:26)

Here are my files for my developers

// adapters/developers.js
import DS from 'ember-data';

export default DS.RESTAdapter.extend({
    namespace: 'api',
});

// models/developers.js
import DS from 'ember-data';

export default DS.Model.extend({
  firstName: DS.attr('string'),
  lastName: DS.attr('string'),
  technology: attr('string'),
});

Not sure what else to post, the error I'm getting is very obscure. When I delete the server/ folder that is created the ember application is able to start again.

Let me know anything else I can post to help.

Upvotes: 4

Views: 330

Answers (1)

Trey Griffith
Trey Griffith

Reputation: 509

I ran into this issue as well, and in my case it happened to be caused by Sublime.

You can test if it's the case for you by closing Sublime and then running ember serve and seeing if the issue persists.

As for a more permanent solution, adding this to your sublime-project file should work:

{
    "folders":
    [
        {
            "folder_exclude_patterns": [
                "tmp",
                "node_modules",
                "bower_components"
            ]
        }
    ]
}

I found the solution in this thread: https://github.com/ember-cli/ember-cli/issues/1260

Upvotes: 2

Related Questions