Skip to content

Commit a2bb741

Browse files
authored
Fix live empty files (codesandbox#3046)
1 parent eb8b166 commit a2bb741

File tree

4 files changed

+102
-133
lines changed

4 files changed

+102
-133
lines changed

packages/app/src/app/components/CodeEditor/VSCode/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -965,9 +965,7 @@ export class VSCode extends React.Component<Props> implements Editor {
965965
),
966966
options: {
967967
inlineClassName: classification.type
968-
? `${classification.kind} ${classification.type}-of-${
969-
classification.parentKind
970-
}`
968+
? `${classification.kind} ${classification.type}-of-${classification.parentKind}`
971969
: classification.kind,
972970
},
973971
}));

packages/app/src/app/overmind/namespaces/editor/internalActions.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import {
1515
sandboxUrl,
1616
editorUrl,
1717
} from '@codesandbox/common/lib/utils/url-generator';
18+
import {
19+
captureException,
20+
logBreadcrumb,
21+
} from '@codesandbox/common/lib/utils/analytics/sentry';
1822

1923
export const ensureSandboxId: Action<string, string> = ({ state }, id) => {
2024
if (state.editor.sandboxes[id]) {
@@ -63,9 +67,15 @@ export const setModuleSavedCode: Action<{
6367
);
6468

6569
if (moduleIndex > -1) {
66-
state.editor.sandboxes[sandbox.id].modules[
67-
moduleIndex
68-
].savedCode = savedCode;
70+
const module = state.editor.sandboxes[sandbox.id].modules[moduleIndex];
71+
72+
logBreadcrumb({
73+
type: 'error',
74+
message: `SETTING UNDEFINED SAVEDCODE FOR CODE: ${module.code}`,
75+
});
76+
captureException(new Error('SETTING UNDEFINED SAVEDCODE'));
77+
78+
module.savedCode = savedCode;
6979
}
7080
};
7181

0 commit comments

Comments
 (0)