indent.js icon indicating copy to clipboard operation
indent.js copied to clipboard

Cannot read properties of undefined (reading 'Int16Array')

Open imperator-maximus opened this issue 4 years ago • 4 comments

Hello, with

import  { indent } from "indent.js";
html=indent.html(html)

I am getting

Uncaught TypeError: Cannot read properties of undefined (reading 'Int16Array')
    at intArray (indent.js:677)
    at indent (indent.js:474)
    at Object.html (indent.js:451)
    at App.svelte:62

Any idea?

imperator-maximus avatar Oct 31 '21 22:10 imperator-maximus

I'm having the same issue. Did you find a workaround?

tinydogio-joshua avatar Oct 14 '22 13:10 tinydogio-joshua

Ditto.

aral avatar Mar 17 '23 12:03 aral

Note: This patch fixes the issue. Will prepare a PR based on it when I get a moment unless someone else beats me to it ;)

https://github.com/zebzhao/indent.js/compare/master...intergestalt:indent.js:master

aral avatar Mar 17 '23 13:03 aral

Update: ended up using js-beautify (https://www.npmjs.com/package/js-beautify)

(Two of the unit tests are failing and you need Node < 12 to run them so it was going to take too long to contribute in a meaningful way.)

aral avatar Mar 17 '23 17:03 aral