Closed threehams closed 3 years ago
This bug was introduced in shiki-twoslash@1.4.0. dom.js exists in 1.3.3. https://github.com/shikijs/twoslash/pull/13
From the PR, it was intentionally removed, but my site examples aren't showing any tooltips. This is after removing the yarn.lock
file and installing everything from scratch. I'll try to keep tracking down what's going on.
You're missing the css update
On Thu, Jul 8, 2021, at 11:47 PM, David Edmondson wrote:
From the PR, it was intentionally removed, but my site examples aren't showing any tooltips. This is after removing the
yarn.lock
file and installing everything from scratch. I'll try to keep tracking down what's going on.— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shikijs/twoslash/issues/70#issuecomment-876792218, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAL7DRGUZMMMKV2WOWX6ELTWYTJ5ANCNFSM5ABTRBTQ.
OK! Got it. 1.4.0 requires changes to CSS for tooltips to appear: https://github.com/shikijs/twoslash/blob/main/packages/remark-shiki-twoslash/README.md
Yeah, I need to do a better job in describing version changes in the lib, that was really a 0.x kinda move, not a 1.x kinda move - #31
Still, I could have struggled with this for two days and still saved time over what I was doing before!
@orta That dom.ts
is no longer needed right? Should we remove that?
Hah, yep, if it's still in there
Environment
Node 16.0.0 Yarn gatsby-remark-shiki-twoslash: 3.0.7 shiki-twoslash: 1.6.2 Windows 10
Bug
I just did a fairly big version jump of
gatsby-remark-shiki-twoslash
from 0.7.0 to 3.0.7, and I've started getting errors on the line:This import mentioned anywhere in the docs, but it was in the TypeScript website code a while back. Strangely, the code is still in
shiki-twoslash
source in this project, anddom.d.ts
is available innode_modules
, but there are no references tosetupTwoslashHovers
anywhere else, and nodom.js
file alongsidedom.d.ts
to import. If I take out the import, it fixes the errors, I lose all tooltips in code examples.Has this changed in v2 or v3? There doesn't seem to be a changelog, so I'm not really sure what I'm doing wrong here.
Reproduction
Project link: https://github.com/threehams/typescript-quirks
I am very new to Gatsby and would have trouble cutting this example down.