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

Fatal error: Cannot read property 'hardStop' of null #105

Closed
rvillanueva opened this issue Apr 6, 2016 · 8 comments
Closed

Fatal error: Cannot read property 'hardStop' of null #105

rvillanueva opened this issue Apr 6, 2016 · 8 comments

Comments

@rvillanueva
Copy link

I couldn't quite isolate the cause, but sometimes my server would crash with the error

Fatal error: Cannot read property 'hardStop' of null

I'm guessing that sometimes options aren't passed through to the stop command.

@rvillanueva
Copy link
Author

Pull request submitted with possible fix: #106

@jlsutherland
Copy link
Collaborator

That actually sounds just right. Maybe we should consider fixing this such that the default is false. What does your Gruntfile look like?

@jlsutherland
Copy link
Collaborator

Also thank you for the PR. Though I may refactor a bit :)

@rvillanueva
Copy link
Author

No prob!

Config:

    express: {
      options: {
        port: process.env.PORT || 9000
      },
      dev: {
        options: {
          script: '<%= yeoman.server %>',
          debug: true
        }
      },
      prod: {
        options: {
          script: '<%= yeoman.dist %>/<%= yeoman.server %>'
        }
      }
    },

Watch:

      express: {
        files: ['<%= yeoman.server %>/**/*.{js,json}'],
        tasks: ['express:dev', 'wait'],
        options: {
          livereload: false,
          spawn: false //Without this option specified express won't be reloaded
        }
      },

@joshperry
Copy link

How can I get this to stop crashing my app? I've tried putting an explicit hardStop: false in all of the possible options hashes to no effect.

@jlsutherland
Copy link
Collaborator

Hi @joshperry, will you please post your gruntfile and grunt-express-server version?

@rvillanueva
Copy link
Author

Hey Josh--if it helps, I was having crashes too but it wasn't actually related to grunt-express-server I think. If your problem looks like #107 , try upgrading your node version.

@joshperry
Copy link

Thanks @rvillanueva and @jlsutherland I'll take a look. #107 definitely looks promising!

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

3 participants