Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Exception when generating hooks #234

Closed
hubertgdev opened this issue Aug 7, 2020 · 2 comments
Closed

Exception when generating hooks #234

hubertgdev opened this issue Aug 7, 2020 · 2 comments

Comments

@hubertgdev
Copy link

Steps to reproduce

I'm discovering the Feathers framework, by following the official guides. At the Hooks step, an error occurs when I run the feathers generate hook command.

This is a regression, since I get the error on @featherjs/cli@4.4.0, but the command works well on @featherjs/cli@4.3.0.

Expected behavior

After answering the questions, it should generate a src/hooks/process-message.hooks.ts file, and update the src/services/messages/messages.hooks.ts file.

Actual behavior

I get this SyntaxError exception:

feathers generate hook
? What is the name of the hook? process-message
? What kind of hook should it be? before
? What service(s) should this hook be for (select none to add it yourself)?
 messages
? What methods should the hook be for (select none to add it yourself)? create

(node:15112) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token, expected "," (13:26)
    at Object._raise (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:763:17)
    at Object.raiseWithData (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:756:17)    
    at Object.raise (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:750:17)
    at Object.unexpected (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:8930:16)      
    at Object.expect (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:8916:28)
    at Object.parseBindingList (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:9305:14)
    at Object.parseFunctionParams (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:12093:24)
    at Object.parseFunction (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:12068:10)
    at Object.parseFunctionStatement (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:11696:17)
    at Object.parseStatementContent (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:11386:21)
    at Object.parseStatement (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:11348:17)
    at Object.parseBlockOrModuleBlockBody (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:11930:25)
    at Object.parseBlockBody (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:11916:10)
    at Object.parseBlockBody (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:892:11)
    at Object.parseTopLevel (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:11279:10)
    at Object.parse (\npm\node_modules\@feathersjs\cli\node_modules\@babel\parser\lib\index.js:12984:10)
(node:15112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

System configuration

Module versions (especially the part that's not working): @feathers/cli@4.4.0

NodeJS version: v12.14.1

Operating System: Windows

@NoahWallace
Copy link

NoahWallace commented Nov 10, 2020

I am running into the same issue on Mac with
@feathersjs/cli@4.4.2
node: v12.14.1
(node:22775) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token, expected "," (17:10)

@daffl
Copy link
Member

daffl commented Dec 15, 2021

This should now be fixed in the latest version.

@daffl daffl closed this as completed Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants