Repository navigation
Description
##Description
When running the tool, the output code is incomplete, missing the class name.
- Type: Bug
Bug
debian 10 64bit.
node version v10.21.0
version 0.1.0
.puml file:
@startuml
class Test
@enduml
puml2code command:
puml2code -i class_diagram.puml -o ./src/ -l cpp
puml2code output
Handlebars: Access has been denied to resolve the property "getFullName" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "getExtends" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "getPrivateFields" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "getFields" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "getConstructorArgs" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "getMethods" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
C++ code output 'Test.h':
/**
* \file .h
*/
#ifndef _h
#define _h
class {
private:
protected:
public:
public:
()
{
// @todo
}
// Public methods
// Protected methods
protected:
// Private methods
private:
}
#endif // _h
Activity
jupe commentedon Jul 28, 2020
Looks a clear bug. probably there is no proper handling when class definition is empy. What happens if you add more content to class? Does example work for you? I’m on holiday so fix is coming a bit later. PR is also welcome :)
RichardB01 commentedon Jul 28, 2020
Ok thanks!
If i try the example this is the output (it doesn't save to a file):
RichardB01 commentedon Jul 28, 2020
Just tested on my macbook, it doesn't work here their, exactly the same results, device details:
Catalina 10.15.6
Node version: 12.18.1
RichardB01 commentedon Jul 28, 2020
Works on my PC 64bit win10
Node v10.15.2
jupe commentedon Jul 29, 2020
so it didn’t work with node v12 but works with node v10 ? I don’t think that OS causes this..
jupe commentedon Jul 29, 2020
note that CI doesn’t validate currently node v12.. have to add it there as well
jupe commentedon Jul 30, 2020
I was not able to reproduce this issue yet with any node version. I added also node v12 to CI and same puml file you mention without luck. output looks correct to me: https://app.circleci.com/pipelines/github/jupe/puml2code/255/workflows/8573a73d-1c03-41a3-86ea-38bc13f2d4ea/jobs/778
Tried also with Mac. CI are running with linux. How did you install tool ? via npm or git clone.. ?
RichardB01 commentedon Jul 30, 2020
I installed puml2code by git cloning the repository and then npm -i -g within the directory
RichardB01 commentedon Jul 31, 2020
I have setup the puml2code project on my macbook, it runs correctly when ran in the development environment (VS Code). It must be something to do with the installation commands.
edit 1:
It looks like this is a security feature of Handlebars see: https://stackoverflow.com/a/61346190/1322654
edit 2:
In the package.json file, Handlebars is set to ^4.1.1 which means the latest handlebars is being installed, this is probably why it installs 4.6.0/latest handlebars instead of 4.1.1
edit 3:
I think that at (https://github.com/jupe/puml2code/blob/master/src/index.js#L144) this line, you need to supply the template with template({element: element}) to fix the security error but i'm not certain, this change will mean you have to add prefixes to the handlebar templates
jupe commentedon May 9, 2021
@Bambofy thanks for investigation help. Unfortunately I haven’t had time to test this more but thanks for you, I’ve now idea’s what to try next..
cTatu commentedon Apr 6, 2022
For me it gives the exact same error "
Handlebars: Access has been denied" on 2 separate environments.The first one:
The second one:
I also tried installing it with
npm -g install puml2codeand by cloning the repo but the result is exactly the same.