Closed johnthad closed 2 years ago
I have confirmed the same issue. I am working on it but it needs the complete rewrite on the code related to the DOM manipulation. So it might take for a while.
I suppose the pre-built script should work without a problem since the issue is due to the update in Cheerio package.
Thanks for the feedback. I thought that had something to do with DOM when I saw import { Cheerio } from '../node_modules/cheerio/lib/cheerio.js';
in DOM.mjs. This was added in 1.0.3, which explains why I now must run asciidoctor-chunker
from global vs the project. (BTW, on a different machine yesterday I saw the same error with Node v16.15.0 and npm 8.5.5. I've not run that down yet.)
Ideally I'd like to run asciidoctor-chunker
locally, from the project. I notice that when cheerio
is installed, it includes node_modules/parse5
. However when asciidoctor-chunker
installs its node_modules
folder is empty. That's why it must run globally, so that import { Cheerio } from '../node_modules/cheerio/lib/cheerio.js';
resolves. As a workaround, I've written a shell script that copies node_modules/cheerio
to node_modules/asciidoctor-chunker/node_modules
before running asciidoctor_chunker
. That works with the latest Node.js & npm, and might be the quickest solution.
I'm out until next week but I'll try to follow up (on yet another Mac) when I can.
Oops! I didn't mean to close this.
Yes, you nailed down the problem right! I have been using the constructor of Cheerio object that is not public. So I had to import it from the locally installed package.
It was the workaround as the Cheerio project changed the API when they made the major upgrade. I didn't want to rewrite the whole thing.
Now, I give up on tweaking around. I will try to rewrite the code fundamentally so to conform the latest API of Cheerio.
Any news on this? I don't want to install it globally, so this project is currently completely unusable for me.
@andilem, about 80% of work is done. But I am currently occupied with other obligations so please be patient for the last 20% to be done.
Meanwhile you can download and use the pre-built script from the Release section. Sorry for the inconvenience.
Sorry for kept you waiting for such a long time. I have just released the latest version 1.0.5!
That works for me. Thank you.
I have been running asciidoctor-chunker 1.0.4 without issue using Node.js v16.15.0 and npm 8.5.5.
When I try switching to Node.js v18.2.0 and npm 8.10.0, I get the following errors:
I switch back to Node.js v16.15.0 and npm 8.5.5 and all works fine.