Hi there! I am trying to separate the actual handwriting from the handwriting detection by storing the editorElement.model.strokeGroups in a Firebase Firestore database and then trying to run the handwriting using a serverless Cloud Function when the strokeGroups are written to the database. This requires iinkJS to be used in nodeJS rather than in the browser with const iink = require("iink-js"). When I try to use the code from the example https://myscript.github.io/iinkJS/examples/v4/rest_no_ui.html however I can't seem to get it working. Is there any way to make it work or is just not possible using the Web SDK? This is the code.
TypeError: Cannot read properties of undefined (reading 'map')
at /Users/brhempen/React/magic-ink-react-js/node_modules/iink-js/dist/iink.min.js:7:81113
at Array.forEach (<anonymous>)
at buildData (/Users/brhempen/React/magic-ink-react-js/node_modules/iink-js/dist/iink.min.js:7:81001)
at postMessage (/Users/brhempen/React/magic-ink-react-js/node_modules/iink-js/dist/iink.min.js:7:79884)
at callPostMessage (/Users/brhempen/React/magic-ink-react-js/node_modules/iink-js/dist/iink.min.js:7:82149)
at /Users/brhempen/React/magic-ink-react-js/node_modules/iink-js/dist/iink.min.js:7:82571
at Array.map (<anonymous>)
at Object.export_ (/Users/brhempen/React/magic-ink-react-js/node_modules/iink-js/dist/iink.min.js:7:82547)
at Object.<anonymous> (/Users/brhempen/React/magic-ink-react-js/testserver.js:149:4)
Currently, the iinkJS has been implemented to work in a web browser and requires the DOM to be used.
The "undefined" is likely that the DOM is missing.
You then understand the easier is faster is indeed that you use the REST API formatting your requests as indicated in the swaggerui.
Also, I noticed your requests are sent to the webdemoapi.myscript.com URL ; the latter is for the demos we provide and shall not be used in a production environment (we do not guarantee any SLA on the latter).
Instead, we invite you to create a account on "cloud.myscript.com", create one/several applications and use your own API keys instead.
Best regards,
Olivier
1 Comment
O
Olivier @MyScript
said
over 2 years ago
Answer
Dear Brhempen,
Thank you for contacting us and your question.
Currently, the iinkJS has been implemented to work in a web browser and requires the DOM to be used.
The "undefined" is likely that the DOM is missing.
You then understand the easier is faster is indeed that you use the REST API formatting your requests as indicated in the swaggerui.
Also, I noticed your requests are sent to the webdemoapi.myscript.com URL ; the latter is for the demos we provide and shall not be used in a production environment (we do not guarantee any SLA on the latter).
Instead, we invite you to create a account on "cloud.myscript.com", create one/several applications and use your own API keys instead.
Brhempen
Hi there! I am trying to separate the actual handwriting from the handwriting detection by storing the editorElement.model.strokeGroups in a Firebase Firestore database and then trying to run the handwriting using a serverless Cloud Function when the strokeGroups are written to the database. This requires iinkJS to be used in nodeJS rather than in the browser with const iink = require("iink-js"). When I try to use the code from the example https://myscript.github.io/iinkJS/examples/v4/rest_no_ui.html however I can't seem to get it working. Is there any way to make it work or is just not possible using the Web SDK? This is the code.
The error I get:
If not possible with the Web SDK another option would be to put together a REST API call using https://swaggerui.myscript.com/#/Batch%20mode/batch right?
Dear Brhempen,
Thank you for contacting us and your question.
Currently, the iinkJS has been implemented to work in a web browser and requires the DOM to be used.
The "
undefined
" is likely that the DOM is missing.You then understand the easier is faster is indeed that you use the REST API formatting your requests as indicated in the swaggerui.
Also, I noticed your requests are sent to the
webdemoapi.myscript.com URL ; the latter is for the demos we provide and shall not be used in a production environment (we do not guarantee any SLA on the latter).
Instead, we invite you to create a account on "cloud.myscript.com", create one/several applications and use your own API keys instead.
Best regards,
Olivier
Olivier @MyScript
Dear Brhempen,
Thank you for contacting us and your question.
Currently, the iinkJS has been implemented to work in a web browser and requires the DOM to be used.
The "
undefined
" is likely that the DOM is missing.You then understand the easier is faster is indeed that you use the REST API formatting your requests as indicated in the swaggerui.
Also, I noticed your requests are sent to the
webdemoapi.myscript.com URL ; the latter is for the demos we provide and shall not be used in a production environment (we do not guarantee any SLA on the latter).
Instead, we invite you to create a account on "cloud.myscript.com", create one/several applications and use your own API keys instead.
Best regards,
Olivier
1 person likes this