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

Handlebars.compile error since version 0.28.0 #967

Closed
alex-michaud opened this issue May 17, 2021 · 16 comments
Closed

Handlebars.compile error since version 0.28.0 #967

alex-michaud opened this issue May 17, 2021 · 16 comments
Labels

Comments

@alex-michaud
Copy link

Describe the bug

Cannot open the doc if compiled with apidoc 0.28.0

Steps to reproduce

1 - compile doc with apidoc 0.28.0
2 - try to open the doc with firefox or chrome, in the browser devtool you will see the error : "TypeError: Handlebars.compile is not a function"

Information

  • Version of apidoc: 0.28.0
  • Operating system (e.g. GNU+Linux/MacOS/Windows): Linux
  • Browser (e.g. firefox, chrome): Firefox and Chrome
@a-tonchev
Copy link

a-tonchev commented May 18, 2021

Same here:

main.js:79 Uncaught (in promise) TypeError: Handlebars.compile is not a function

@NicolasCARPi
Copy link
Collaborator

@0skSG could you have a look? Probably linked to your PR, no?

@kipaut
Copy link

kipaut commented May 18, 2021

I have the same problem
Rolled back to version 0.27.0

Version of apidoc: 0.28.0
Operating system : Linux
Browser: Chrome Version 90.0.4430.85

@0skSG
Copy link
Contributor

0skSG commented May 18, 2021

In fact it could be ralated. I cannot discard that option.
What I did in my last PR was to update the hardcoded minified file inside the vendor folder, downloading it from here.
Please provide any feedback or suggestion, I honestly though PR's checks and reviews were covering the needed scenarios, in order to make sure nothing was broken. I will try to investigate more on that.

@OliverwengFiltered
Copy link

same issue here, had to downgrade to the previous version.

@0skSG
Copy link
Contributor

0skSG commented May 19, 2021

Hello, I've been investigating a bit more on that.
I managed to fix this issue in my local machine replacing the handlebars.min file that right now with v0.28.0 is installing in my node_modules folders, by the one that I'm adding in this PR #969.
Should be fine if someone else can double check that, downloading from here the version that contains the compiler + the runtime.
Thank you.

@NicolasCARPi
Copy link
Collaborator

Fixed in 0.28.1.

@seyfer
Copy link

seyfer commented Jul 14, 2021

Seems like this issue PR caused another issue. Now I am getting

"Missing helper: \"if_neq\""

Should be replaced to unless everywhere. Or new handlebars min file does not include this helper, but it should.

@prashant93
Copy link

not fixed in 0.28.1

@prashant93
Copy link

prashant93 commented Jul 20, 2021

Screenshot 2021-07-20 170536

image

@NicolasCARPi
Copy link
Collaborator

@prashant93 this issue is with your CSP policy, no? Nothing to do with the lib.

@prashant93
Copy link

Thanks @NicolasCARPi

@seyfer
Copy link

seyfer commented Aug 2, 2021

@NicolasCARPi why not add handlebars ^4.7.7 to package JSON as a dependency?

I do not use apidocs global install, I have added to my package.json

"apidoc": "^0.28.1",
"handlebars": "^4.7.7",

and

"scripts": {
   "docs": "apidoc -i src/ -o doc/"

and I still have this error with

"Missing helper: \"if_neq\""

when I do

yarn docs

I guess apidocs load some not compatible handlebars version from somewhere?

@NicolasCARPi
Copy link
Collaborator

@NicolasCARPi why not add handlebars ^4.7.7 to package JSON as a dependency?

What do you mean? It's there already!

And yes it's loading it from the template/vendor directory, but it's 4.7.7, at least in master branch.

This is something I want to fix: load stuff from node_modules with a webpack step. But I did not write this software, I'm just dedicating some time to it because it was almost abandoned at some point, fortunately the owner gave me some access to try and help. So there is a lot of technical debt that accumulated and it requires a significant amount of work to bring it to today's web standards.

As for the missing helper thing, a new patch should come out, because the current latest version on npm has this bug, but not the version from master.

@seyfer
Copy link

seyfer commented Aug 3, 2021

@NicolasCARPi ahh, thank you very much, I was about to try master today instead of the latest version. Had a feeling that maybe fixes were not tagged yet in a new version. Or will wait for 0.28.2 with fixes.

oh you tagged 0.29.0 already. great! 🎉

upd: just tested and it works. now I can finish documenting my new microservice for the company. this package really used and has a lot of stars. bring more maintainers on board if you feel like you need help. :)

@NicolasCARPi
Copy link
Collaborator

bring more maintainers on board if you feel like you need help. :)

@seyfer, well this is exactly why I proposed my help to @rottmann. I saw he needed help with issue triage, merging PR and fixing bugs. But you know, finding someone that will actually help with the project is easiest said than done. Most people are happy to propose their help but when it comes to actually doing something it ends up with "sorry I didn't have time but I'll have some next week". Everyone can make PRs and comment on issues.

Some of the big issues with this project:

  • it doesn't generate money for its creator -> hence the lost in interest, one has to feed his family and focus on projects that do
  • the codebase has accumulated a lot of debt over time and there was some dubious design choices (like putting the parser as another repo, makes things difficult ; I mean there was a good reason at the time, but it turns out it's not so great).
  • I'm not familiar enough with the codebase to rewrite a large part of it and make it "great again"
  • because of its popularity, there are a lot of users with issues to deal with, and this can lead to the "open source maintainer burnout", with a never ending stream of bug reports and feature requests, and only a very small percentage of PR actually fixing bugs and not introducing more code to maintain/fix.

Some of the big advantages of this project:

  • @rottmann is still present and publishing things on npm when I tag new releases
  • the popularity of this project makes it more likely to get good PRs
  • it kind does what we want it to do, more or less 😆

giphy

Anyway, I'm here to fix the leaks and do basic maintainance. Maybe at some point I'll give this project a good whip, but with @rottmann we discussed about starting from scratch, which could be the death or rebirth of this project, hard to say, sometimes planning a complete rewrite is a bad idea, sometimes it is good. I'm all for a rewrite, but one has to consider the scope of such a project, it's far from being trivial. So in the end, maybe fixing what exists might be better...

Maybe I'll start by deprecating apidoc-core and importing the parser in this repo... @rottmann what do you think about such a change? It's never too late to revert a bad decision!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants