Skip to content

Commit 2894637

Browse files
author
Ives van Hoorne
committed
Update
1 parent 9dc22e1 commit 2894637

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/react-sandpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-smooshpack",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "",
55
"keywords": [],
66
"license": "SEE LICENSE.MD IN ROOT",

packages/sandpack/src/manager/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,16 @@ export default class PreviewManager {
132132
{}
133133
);
134134

135-
const packageJSON = JSON.parse(files['/package.json'].code);
135+
let packageJSON = generatePackageJSON(
136+
this.sandboxInfo.files,
137+
this.sandboxInfo.dependencies,
138+
this.sandboxInfo.entry
139+
);
140+
try {
141+
packageJSON = JSON.parse(files['/package.json'].code);
142+
} catch (e) {
143+
console.error('Could not parse package.json file: ' + e.message);
144+
}
136145

137146
// TODO move this to a common format
138147
const normalizedModules = Object.keys(files).reduce(

0 commit comments

Comments
 (0)