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

rel 0.4.8 Object #<Object> has no method 'async' on exit #30

Closed
RBLU opened this issue Dec 5, 2013 · 7 comments · Fixed by #31
Closed

rel 0.4.8 Object #<Object> has no method 'async' on exit #30

RBLU opened this issue Dec 5, 2013 · 7 comments · Fixed by #31

Comments

@RBLU
Copy link

RBLU commented Dec 5, 2013

When I update my build to the newest 0.4.8 I get the following error when grunt is exiting and the server should be stopped.

When I fix the dependency to 0.4.7 it works again.

TypeError: Object #<Object> has no method 'async'
    at process.stop (/Users/retoblunschi/Documents/workspace/yp-backend/node_modules/grunt-express-server/tasks/lib/server.js:111:39)
    at process.EventEmitter.emit (events.js:117:20)
    at process.exit (node.js:707:17)
    at tryToExit (/Users/retoblunschi/Documents/workspace/yp-backend/node_modules/grunt/node_modules/exit/lib/exit.js:17:15)
    at Object.exit (/Users/retoblunschi/Documents/workspace/yp-backend/node_modules/grunt/node_modules/exit/lib/exit.js:34:3)
    at Object.task.options.done (/Users/retoblunschi/Documents/workspace/yp-backend/node_modules/grunt/lib/grunt.js:147:14)
    at Task.<anonymous> (/Users/retoblunschi/Documents/workspace/yp-backend/node_modules/grunt/lib/util/task.js:261:25)
    at Task.<anonymous> (/Users/retoblunschi/Documents/workspace/yp-backend/node_modules/grunt/lib/util/task.js:215:7)
    at null._onTimeout (/Users/retoblunschi/Documents/workspace/yp-backend/node_modules/grunt/lib/util/task.js:225:33)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

thanks,
Reto

@ericclemmons
Copy link
Owner

Can you let me know what what grunt task(s) you're running & what your express block looks like? I need to be able to reproduce this...

@RBLU
Copy link
Author

RBLU commented Dec 5, 2013

sure:
I am running this task:
grunt.registerTask('test', ['jshint', 'express:dev', 'jasmine_node']);
the relevant grunt config blocks:

jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            gruntfile: {
                src: ['Gruntfile.js']
            },
            code: {
                src: ['app.js', 'config/**/*.js', 'models/**/*.js', 'routes/**/*.js']
            }
        },
express: {
            options: {
                // Override defaults here
            },
            dev: {
                options: {
                    script: './app.js',
                    delay: 5000,
                    output: null  // is needed, otherwise delay is ignored after any server output to System.out

                }
            },
 jasmine_node: {
            specNameMatcher: "spec", // load only specs containing specNameMatcher
            projectRoot: ".",
            requirejs: false,
            autotest: true,
            forceExit: true,
            jUnit: {
                report: true,
                savePath: "./build/reports/jasmine/",
                useDotNotation: true,
                consolidate: true
            }
        }

my current dependency versions:

"devDependencies": {
    "grunt-contrib-jshint": "~0.6.x",
    "grunt-jasmine-node": "0.1.x",
    "grunt": "0.4.x",
    "grunt-express-server": "0.4.7"
  },

with this it works, when I put "0.4.x" for grunt-express-server, I get the error above

@ericclemmons
Copy link
Owner

Reverted v0.4.8 & just published v0.4.9 until this is resolved. Sorry about that :(

@ericclemmons
Copy link
Owner

(Can you confirm v0.4.9 works for you? That way I can go back to the original problem)

@RBLU
Copy link
Author

RBLU commented Dec 5, 2013

confirmed: v0.4.9 is running fine here
thanks

@ericclemmons
Copy link
Owner

Good deal! Back to resolving the other issue now :)

@sebgie
Copy link
Contributor

sebgie commented Dec 6, 2013

I can reproduce that problem, it appears when the express server isn't stopped in gruntfile.js. The 'exit' event will call stop, but has no access to the current grunt task anymore.

sebgie added a commit to sebgie/grunt-express-server that referenced this issue Dec 6, 2013
closes ericclemmons#28
closes ericclemmons#30
- added stopdone to wait for server to stop
- renamed done to startdone
- added conditional for `grunt.task.current.async()`
- added testsequence which is able to reproduce the bug without my
changes to server.js
- added `express:defaults` without `express:defaults:stop` at the end
of the file to reproduce missing 'async'
eluck pushed a commit to eluck/grunt-express-server that referenced this issue Dec 15, 2013
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

Successfully merging a pull request may close this issue.

3 participants