{"action":"created","issue":{"url":"https://api.github.com/repos/google/blockly/issues/1694","repository_url":"https://api.github.com/repos/google/blockly","labels_url":"https://api.github.com/repos/google/blockly/issues/1694/labels{/name}","comments_url":"https://api.github.com/repos/google/blockly/issues/1694/comments","events_url":"https://api.github.com/repos/google/blockly/issues/1694/events","html_url":"https://github.com/google/blockly/issues/1694","id":303343505,"number":1694,"title":"Use blockly on nodejs，variables is not work","user":{"login":"sunshine4me","id":9856250,"avatar_url":"https://avatars0.githubusercontent.com/u/9856250?v=4","gravatar_id":"","url":"https://api.github.com/users/sunshine4me","html_url":"https://github.com/sunshine4me","followers_url":"https://api.github.com/users/sunshine4me/followers","following_url":"https://api.github.com/users/sunshine4me/following{/other_user}","gists_url":"https://api.github.com/users/sunshine4me/gists{/gist_id}","starred_url":"https://api.github.com/users/sunshine4me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunshine4me/subscriptions","organizations_url":"https://api.github.com/users/sunshine4me/orgs","repos_url":"https://api.github.com/users/sunshine4me/repos","events_url":"https://api.github.com/users/sunshine4me/events{/privacy}","received_events_url":"https://api.github.com/users/sunshine4me/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-08T03:27:34Z","updated_at":"2018-03-08T17:22:33Z","closed_at":"2018-03-08T17:22:33Z","author_association":"NONE","body":"I will use blockly on nodejs,I can get the xml to code，such as `\"test\"==\"test\";`\r\nBut when the xml has variables,It was error. such as `var test == \"test\";`\r\n\r\nIt's my code :\r\n```javascript\r\n'use strict';\r\nglobal.DOMParser = require('xmldom').DOMParser;\r\nglobal.Blockly = require('./blockly/blockly_uncompressed.js');\r\n\r\nrequire('./blockly/blocks/logic.js');\r\nrequire('./blockly/blocks/loops.js');\r\nrequire('./blockly/blocks/math.js');\r\nrequire('./blockly/blocks/text.js');\r\nrequire('./blockly/blocks/lists.js');\r\nrequire('./blockly/blocks/colour.js');\r\nrequire('./blockly/blocks/variables.js');\r\nrequire('./blockly/blocks/procedures.js');\r\n\r\nrequire('./blockly/generators/javascript.js');\r\nrequire('./blockly/generators/javascript/logic.js');\r\nrequire('./blockly/generators/javascript/loops.js');\r\nrequire('./blockly/generators/javascript/math.js');\r\nrequire('./blockly/generators/javascript/text.js');\r\nrequire('./blockly/generators/javascript/lists.js');\r\nrequire('./blockly/generators/javascript/colour.js');\r\nrequire('./blockly/generators/javascript/variables.js');\r\nrequire('./blockly/generators/javascript/procedures.js');\r\n\r\nlet xmlText = '<xml xmlns=\"http://www.w3.org/1999/xhtml\"><block type=\"variables_set\" id=\"jfFPQ]_YT!6}_yvbm4a|\" x=\"113\" y=\"37\"><field name=\"VAR\">test</field><value name=\"VALUE\"><block type=\"text\" id=\"p^c*Oc7n=tA^)8E^koou\"><field name=\"TEXT\">test</field></block></value></block></xml>';\r\n\r\nvar xml = Blockly.Xml.textToDom(xmlText);\r\n// Create a headless workspace.\r\nvar workspace = new Blockly.Workspace();\r\nBlockly.Events.disable();\r\nBlockly.Xml.domToWorkspace(xml, workspace);\r\n\r\nvar code = Blockly.JavaScript.workspaceToCode(workspace);\r\nconsole.log(code);\r\n```\r\nThe variables was error:\r\n![image](https://user-images.githubusercontent.com/9856250/37131283-a31f8584-22c2-11e8-93c6-c398160ff3c5.png)\r\n\r\n\r\n![image](https://user-images.githubusercontent.com/9856250/37131518-a5a830c0-22c3-11e8-91a9-80c4c08b8468.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/google/blockly/issues/comments/371558774","html_url":"https://github.com/google/blockly/issues/1694#issuecomment-371558774","issue_url":"https://api.github.com/repos/google/blockly/issues/1694","id":371558774,"user":{"login":"RoboErikG","id":11066279,"avatar_url":"https://avatars2.githubusercontent.com/u/11066279?v=4","gravatar_id":"","url":"https://api.github.com/users/RoboErikG","html_url":"https://github.com/RoboErikG","followers_url":"https://api.github.com/users/RoboErikG/followers","following_url":"https://api.github.com/users/RoboErikG/following{/other_user}","gists_url":"https://api.github.com/users/RoboErikG/gists{/gist_id}","starred_url":"https://api.github.com/users/RoboErikG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoboErikG/subscriptions","organizations_url":"https://api.github.com/users/RoboErikG/orgs","repos_url":"https://api.github.com/users/RoboErikG/repos","events_url":"https://api.github.com/users/RoboErikG/events{/privacy}","received_events_url":"https://api.github.com/users/RoboErikG/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T17:22:32Z","updated_at":"2018-03-08T17:22:32Z","author_association":"MEMBER","body":"Please ask this on the mailing list. The Blockly team doesn't maintain the node release and it looks like there's something wrong with your setup or the version of your variable blocks. Someone on the forum should have a better idea what's up.\r\n\r\nhttps://groups.google.com/forum/#!forum/blockly"}}
{"actor":{"display_login":"RoboErikG"}}