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

Project build fails with Template Render Error #108

Closed
CoolSpy3 opened this issue Dec 22, 2020 · 5 comments · Fixed by #109
Closed

Project build fails with Template Render Error #108

CoolSpy3 opened this issue Dec 22, 2020 · 5 comments · Fixed by #109
Labels
bug Something isn't working released

Comments

@CoolSpy3
Copy link

Describe the bug

Building this project produces the following error:

Something went wrong:
Template render error: (node_modules\@asyncapi\generator\node_modules\@asyncapi\java-spring-template\template\src\main\java\com\asyncapi\model\$$objectSchema$$.java) [Line 135, Column 90]
  ReferenceError: obj is not defined
    at Object._prettifyError (node_modules\nunjucks\src\lib.js:36:11)
    at node_modules\nunjucks\src\environment.js:561:19
    at Template.root [as rootRenderFunc] (eval at _compile (node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:1532:3)
    at Template.render (node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:550:10)
    at Environment.renderString (node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:378:17)
    at node-v14.15.3-win-x64\node-v14.15.3-win-x64\node_modules\@asyncapi\generator\lib\renderer\nunjucks.js:32:14
    at new Promise (<anonymous>)
    at nunjucksExport.renderNunjucks (node_modules\@asyncapi\generator\lib\renderer\nunjucks.js:31:10)
    at Generator.renderFile (node_modules\@asyncapi\generator\lib\generator.js:678:12)
    at async Generator.renderAndWriteToFile (node_modules\@asyncapi\generator\lib\generator.js:593:28)
    at async Generator.generateSeparateFile (node_modules\@asyncapi\generator\lib\generator.js:580:5)
    at async Promise.all (index 0)
    at async Generator.filesGenerationHandler (node_modules\@asyncapi\generator\lib\generator.js:508:9)
    at async Walker.<anonymous> (node_modules\@asyncapi\generator\lib\generator.js:442:11)

unless java-spring-template is downgraded to version 0.20.1.

How to Reproduce

  1. Install AsyncAPI
  2. Clone this project
  3. Run npm install -g graceful-fs to bypass issue Error: Cannot find module 'graceful-fs' (GitBash / Win10) #80
  4. Run ag -o <dir> wpilib-ws-schema/schema/wpilib-ws.yaml @asyncapi/java-spring-template
  5. Run ag -o <dir> wpilib-ws-schema/schema/wpilib-ws.yaml @asyncapi/[email protected]

Expected behavior

The code should build without errors on the latest version of java-spring-template

@CoolSpy3 CoolSpy3 added the bug Something isn't working label Dec 22, 2020
@github-actions
Copy link

Welcome to AsyncAPI. Thanks a lot for reporting your first issue.

Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@derberg
Copy link
Member

derberg commented Dec 23, 2020

@CoolSpy3 I found the bug. I tested and your schema passes successfully with my change but I'm not able to say if the result is correct or not. Please check on your side, when you run ag just pass this as the template https://github.com/derberg/java-spring-template/#fix-obj

@CoolSpy3
Copy link
Author

I can confirm that running that branch fixes the error. Thank you for your help :)

@derberg
Copy link
Member

derberg commented Dec 23, 2020

@CoolSpy3 awesome, I'll just grab a reviewer and we'll release it today

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.22.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants