Skip to content

Twoslash is unstable and unstyled #64

@amirhhashemi

Description

@amirhhashemi

After adding the twoslash meta-data to a code block, I encountered an error that caused the server to crash:

Error: Plugin "expressive-code-twoslash" caused an error in its "preprocessCode" hook. Error message:
## Errors were thrown in the sample, but not included in an error tag

These errors were not marked as being expected: 7006.
Expected: // @errors: 7006

Compiler Errors:

index.tsx
  [7006] 16 - Parameter 'props' implicitly has an 'any' type.

Here is the code block:

```tsx twoslash
function Switch(props) {
	return props.children;
}
```

It seems to be related to the type of error in the code. I'm not sure if this is the expected behavious of Twoslash, but I expected it to be more fault-tolerant.

When I fixed the type error:

```tsx twoslash
function Switch(props: { children: string }) {
	return props.children;
}
```

I no longer received an error, but I noticed the following issue with the rendering:

Image

The popup is not hidden by default, and the code has a scrollbar. It seems that some styling adjustments are needed, but I couldn't find any relevant documentation either in your docs or in the Twoslash docs.

SolidBase version: 0.0.24
SolidBase config: https://github.com/solidjs/solid-docs/blob/dd580f9e439d703f01d06b08585d1c190597ae3d/app.config.ts#L46

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions