Skip to content

Commit 21b787e

Browse files
committed
Fix sketch <base> when usaved, handle nonstring messages
1 parent 9686236 commit 21b787e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class Editor extends React.Component {
253253
if (consoleEvent.method === 'error') {
254254
// It doesn't work if you create a new Error, but this works
255255
// LOL
256-
const errorObj = { stack: consoleEvent.data[0] };
256+
const errorObj = { stack: consoleEvent.data[0].toString() };
257257
StackTrace.fromError(errorObj).then((stackLines) => {
258258
this.props.expandConsole();
259259
const line = stackLines.find(

client/modules/Preview/EmbedFrame.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function injectLocalFiles(files, htmlFile, options) {
214214
const sketchDoc = parser.parseFromString(htmlFile.content, 'text/html');
215215

216216
const base = sketchDoc.createElement('base');
217-
base.href = `${window.origin}${basePath}/`;
217+
base.href = `${window.origin}${basePath}${basePath.length > 1 && '/'}`;
218218
sketchDoc.head.appendChild(base);
219219

220220
resolvePathsForElementsWithAttribute('src', sketchDoc, resolvedFiles);

0 commit comments

Comments
 (0)