Open adamhinckley opened 9 months ago
Hi thanks for opening this issue. Could you show me the file you added //ts-worksheet to it? This .toedit.ts is a temporary file which gets created by ts-morph.
This error means that I don't create valid wrapper code for your file. I should be able to fix it if I have the source code of the file or a minimal reproducible codesample.
I'm getting the same thing. It seems to break on my stitches components.
@smol-honk do you have a code example?
@smol-honk do you have a code example?
Unfortunately it's my work code. I'll try to put together something with the same stack to share.
Would be great. A minimal reproducible example would be nice.
I've done a basic example with styled and createStitches but did not receive any errors. Would be great to see where it fails for you. Which function for example.
Sorry I'm late to this, but here's one file that I don't feel too bad sharing from my work code. Hopefully it's enough context to be helpful.
//ts-worksheet-with-variables
/** @jsxImportSource @emotion/react */
//libraries
import AddCircleIcon from '@mui/icons-material/AddCircle';
import { css } from '@emotion/react';
import { Typography } from '@mui/material';
import { useContext } from 'react';
//Local
import { BuilderContext } from '../../context/BuilderContext';
import { ViewModeEnum } from '../../util/globalTypes';
const AddContentStyles = (zonePrimaryColor: string, zoneHoverColor: string) => {
return css`
display: flex;
flex-direction: row;
color: ${zonePrimaryColor};
align-items: center;
width: 100%;
min-height: 72px;
justify-content: center;
&.is-over {
box-shadow: 0 0 0 2px ${zoneHoverColor};
}
p {
margin-left: 10px;
font-weight: 700;
font-size: 0.875rem;
letter-spacing: 1px;
text-transform: uppercase;
}
`;
};
type AddContentProps = {
isOver: boolean;
zonePrimaryColor: string;
zoneHoverColor: string;
};
const AddContent = ({ isOver, zonePrimaryColor, zoneHoverColor }: AddContentProps) => {
const { viewMode } = useContext(BuilderContext);
const isMobileView = viewMode === ViewModeEnum.MOBILE;
return (
<div
css={AddContentStyles(zonePrimaryColor, zoneHoverColor)}
className={`${isOver ? 'is-over ' : ''}${isMobileView ? 'mobile-add-content ' : ''}`}
>
<AddCircleIcon className="add-icon" />
<Typography>Drop Module Here</Typography>
</div>
);
};
export default AddContent;
This is the error
ts-worksheet: An Error happend during the running of the worksheet. If you think there is something wrong with the plugin, please file an issue: : Error: Manipulation error: A syntax error was inserted. [96mUsers/adam.hinckley/projects/exit-offer-customizer-ui/src/components/mainDisplay/.toedit.ts[0m:[93m50[0m:[93m4[0m - [91merror[0m[90m TS1005: [0m'>' expected. [7m50[0m css={AddContentStyles(zonePrimaryColor, zoneHoverColor)} [7m [0m [91m ~~~[0m [96mUsers/adam.hinckley/projects/exit-offer-customizer-ui/src/components/mainDisplay/.toedit.ts[0m:[93m50[0m:[93m7[0m - [91merror[0m[90m TS1005: [0m')' expected. [7m50[0m css={AddContentStyles(zonePrimaryColor, zoneHoverColor)} [7m [0m [91m ~[0m [96mUsers/adam.hinckley/projects/exit-offer-customizer-ui/src/components/mainDisplay/.toedit.ts[0m:[93m51[0m:[93m90[0m - [91merror[0m[90m TS1136: [0mProperty assignment expected. [7m51[0m tsWorksheetWatch({type: 'expression', variab...
Thanks. I will look into it :)
I work with a few repos at work that us TS. When I add
//ts-worksheet
at the top of any file and save I get this error:It looks like it's saying there is a file called
.toedit.ts
in my util folder, but that file does not exist in my repo anywhere.