You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a new project using this template, the @asyncapi/parser version is "^2.0.0-next-major.15". It appears that there are breaking changes in this version when coming from 1.x. Because of these changes, the following errors is thrown when trying to run the generated application out-the-box (after running npm install):
(node:10540) UnhandledPromiseRejectionWarning: TypeError: parse is not a function
at Object.module.exports.init (D:\Code\AsyncApiFoodDelivery\ws-server\src\lib\asyncapi.js:23:20)
at start (D:\Code\AsyncApiFoodDelivery\ws-server\src\api\index.js:9:18)
at Object.<anonymous> (D:\Code\AsyncApiFoodDelivery\ws-server\src\api\index.js:27:1)
at Module._compile (internal/modules/cjs/loader.js:1114:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10540) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:10540) [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.
After some testing, I noticed that the parse method is present in 1.x versions of the @asyncapi/parser package. When updating my package.json file to reference "^1.18.1" the application works.
We can fix this by either:
Updating the package.json file in the template to reference "^1.18.1" OR
Rewrite the template to be compatible with the 2.x version of the @asyncapi/parser. Will this be a big change? Should we do this if 2.x isn't released yet?
How to Reproduce
Steps to reproduce the issue. Attach all resources that can help us understand the issue:
Generate a project using the template: ag asyncapi.yaml @asyncapi/nodejs-ws-template -p server=dev -o ws-server
Install NPM packages: npm install
Run the application: npm run start
Expected behaviour
The application should start successfully and let me connect to the WebSocket paths.
The text was updated successfully, but these errors were encountered:
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
better imho is to make sure template works with latest parser as anyway 2.0 will come in few months. And we just need proper tests that prevent bump in case it is breaking generation. We have test that generates code from template, we do not have test that actually starts the generated app
Describe the bug
When creating a new project using this template, the
@asyncapi/parser
version is"^2.0.0-next-major.15"
. It appears that there are breaking changes in this version when coming from1.x
. Because of these changes, the following errors is thrown when trying to run the generated application out-the-box (after runningnpm install
):After some testing, I noticed that the
parse
method is present in1.x
versions of the@asyncapi/parser
package. When updating mypackage.json
file to reference"^1.18.1"
the application works.We can fix this by either:
package.json
file in the template to reference"^1.18.1"
OR2.x
version of the@asyncapi/parser
. Will this be a big change? Should we do this if2.x
isn't released yet?How to Reproduce
Steps to reproduce the issue. Attach all resources that can help us understand the issue:
ag asyncapi.yaml @asyncapi/nodejs-ws-template -p server=dev -o ws-server
npm install
npm run start
Expected behaviour
The application should start successfully and let me connect to the WebSocket paths.
The text was updated successfully, but these errors were encountered: