Skip to content

Commit 6213d2e

Browse files
francoischalifourSaraVieira
authored andcommitted
Fix sandboxes without dependencies (codesandbox#1190)
<!-- Please make sure you are familiar with and follow the instructions in the contributing guidelines (found in the CONTRIBUTING.md file). Please fill out the information below to expedite the review and (hopefully) merge of your pull request! --> <!-- Is it a Bug fix, feature, docs update, ... --> **What kind of change does this PR introduce?** Fixes codesandbox#1189. <!-- You can also link to an open issue here --> **What is the current behavior?** See codesandbox#1189. From my understanding, the faulty commit is 8713bb1. I defaulted both dependencies and dev dependencies to an empty object so that this doesn't throw: codesandbox@8713bb1#diff-2782e23a6ee94211823963997b4cf469R88 <!-- if this is a feature change --> **What is the new behavior?** This kind of sandboxes works again: [see result for InstantSearch.js template](http://pr1190.cs.lbogdan.tk/s/github/algolia/create-instantsearch-app/tree/templates/instantsearch.js). <!-- Have you done all of these things? --> **Checklist**: <!-- add "N/A" to the end of each line that's irrelevant to your changes --> <!-- to check an item, place an "x" in the box like so: "- [x] Documentation" --> - [ ] Documentation - [ ] Tests - [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? --> - [x] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions --> <!-- feel free to add additional comments --> <!-- Thank you for contributing! -->
1 parent 4e9f2c2 commit 6213d2e

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

β€Ž.all-contributorsrcβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,16 @@
633633
"design",
634634
"ideas"
635635
]
636+
},
637+
{
638+
"login": "francoischalifour",
639+
"name": "FranΓ§ois Chalifour",
640+
"avatar_url": "https://avatars3.githubusercontent.com/u/6137112?v=4",
641+
"profile": "https://francoischalifour.com",
642+
"contributions": [
643+
"bug",
644+
"code"
645+
]
636646
}
637647
],
638648
"repoType": "github"

β€ŽREADME.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [CodeSandbox](https://codesandbox.io) [![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/KE3TbEZ) [![All Contributors](https://img.shields.io/badge/all_contributors-65-orange.svg?style=flat-square)](#contributors) [![CircleCI](https://circleci.com/gh/CompuIves/codesandbox-client.svg?style=svg)](https://circleci.com/gh/CompuIves/codesandbox-client) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
1+
# [CodeSandbox](https://codesandbox.io) [![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/KE3TbEZ) [![All Contributors](https://img.shields.io/badge/all_contributors-66-orange.svg?style=flat-square)](#contributors) [![CircleCI](https://circleci.com/gh/CompuIves/codesandbox-client.svg?style=svg)](https://circleci.com/gh/CompuIves/codesandbox-client) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
22

33
![Banner](https://codesandbox.io/static/img/banner.png)
44

@@ -49,5 +49,5 @@ Thanks goes to these wonderful people
4949
| [<img src="https://avatars0.githubusercontent.com/u/1820292?v=4" width="100px;"/><br /><sub><b>Michel Weststrate</b></sub>](https://twitter.com/mweststrate)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=mweststrate "Code") | [<img src="https://avatars0.githubusercontent.com/u/52824?v=4" width="100px;"/><br /><sub><b>Oleg</b></sub>](https://kof.github.io)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=kof "Code") | [<img src="https://avatars0.githubusercontent.com/u/1127037?v=4" width="100px;"/><br /><sub><b>Paul Sherman</b></sub>](https://www.pshrmn.com)<br />[πŸ›](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Apshrmn "Bug reports") [πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=pshrmn "Code") | [<img src="https://avatars2.githubusercontent.com/u/9244507?v=4" width="100px;"/><br /><sub><b>Ro Savage</b></sub>](https://github.com/ro-savage)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=ro-savage "Code") | [<img src="https://avatars3.githubusercontent.com/u/13242392?v=4" width="100px;"/><br /><sub><b>Sam Denty</b></sub>](https://samdd.me)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=samdenty99 "Code") | [<img src="https://avatars1.githubusercontent.com/u/3087225?v=4" width="100px;"/><br /><sub><b>Zephraph</b></sub>](https://github.com/zephraph)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=zephraph "Code") | [<img src="https://avatars1.githubusercontent.com/u/1900735?v=4" width="100px;"/><br /><sub><b>Josh Waller</b></sub>](https://www.joshwaller.me)<br />[πŸ›](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Amdxprograms "Bug reports") [πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=mdxprograms "Code") [πŸ“–](https://github.com/CompuIves/codesandbox-client/commits?author=mdxprograms "Documentation") |
5050
| [<img src="https://avatars0.githubusercontent.com/u/1195863?v=4" width="100px;"/><br /><sub><b>Joe Ng'ethe</b></sub>](http://joey.co.ke)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=joeynimu "Code") | [<img src="https://avatars0.githubusercontent.com/u/576935?v=4" width="100px;"/><br /><sub><b>Carles Codony</b></sub>](https://github.com/bitblitter)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=bitblitter "Code") | [<img src="https://avatars2.githubusercontent.com/u/468006?v=4" width="100px;"/><br /><sub><b>Vytenis</b></sub>](https://github.com/FDiskas)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=FDiskas "Code") | [<img src="https://avatars1.githubusercontent.com/u/894149?v=4" width="100px;"/><br /><sub><b>Manuel DuguΓ©</b></sub>](http://manueldugue.de)<br />[πŸ›](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Amdugue "Bug reports") [πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=mdugue "Code") | [<img src="https://avatars2.githubusercontent.com/u/5346497?v=4" width="100px;"/><br /><sub><b>Demian Dekoninck</b></sub>](https://dem.be)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=DemianD "Code") | [<img src="https://avatars2.githubusercontent.com/u/3144549?v=4" width="100px;"/><br /><sub><b>Drake Costa</b></sub>](http://www.saeris.io)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=Saeris "Code") | [<img src="https://avatars2.githubusercontent.com/u/433394?v=4" width="100px;"/><br /><sub><b>Marko Stijak</b></sub>](https://cxjs.io/)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=mstijak "Code") |
5151
| [<img src="https://avatars2.githubusercontent.com/u/10588170?v=4" width="100px;"/><br /><sub><b>Ilya</b></sub>](https://twitter.com/ilya_komar0ff)<br />[πŸ’¬](#question-Komar0ff "Answering Questions") [πŸ€”](#ideas-Komar0ff "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/10627086?v=4" width="100px;"/><br /><sub><b>Emerson Laurentino</b></sub>](https://twitter.com/elaurent_)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=emersonlaurentino "Code") [πŸ›](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Aemersonlaurentino "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/180963?v=4" width="100px;"/><br /><sub><b>Aaron Reisman</b></sub>](https://github.com/lifeiscontent)<br />[πŸ›](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Alifeiscontent "Bug reports") [πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=lifeiscontent "Code") [πŸ“¦](#platform-lifeiscontent "Packaging/porting to new platform") | [<img src="https://avatars2.githubusercontent.com/u/19484365?v=4" width="100px;"/><br /><sub><b>Colton Colcleasure</b></sub>](https://github.com/colshacol)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=colshacol "Code") [πŸ›](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Acolshacol "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/497242?v=4" width="100px;"/><br /><sub><b>PJ Walker</b></sub>](https://github.com/PJWalker)<br />[πŸ›](https://github.com/CompuIves/codesandbox-client/issues?q=author%3APJWalker "Bug reports") [πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=PJWalker "Code") | [<img src="https://avatars2.githubusercontent.com/u/29819102?v=4" width="100px;"/><br /><sub><b>Satya Rohith</b></sub>](https://satya.tech)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=satyarohith "Code") [πŸ“–](https://github.com/CompuIves/codesandbox-client/commits?author=satyarohith "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/17421347?v=4" width="100px;"/><br /><sub><b>Melanie Seltzer</b></sub>](https://www.melanieseltzer.io/)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=melanieseltzer "Code") |
52-
| [<img src="https://avatars1.githubusercontent.com/u/23313266?v=4" width="100px;"/><br /><sub><b>ZYSzys</b></sub>](http://zyszys.top)<br />[πŸ“–](https://github.com/CompuIves/codesandbox-client/commits?author=ZYSzys "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1051509?v=4" width="100px;"/><br /><sub><b>Sara Vieira</b></sub>](http://iamsaravieira.com)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=SaraVieira "Code") [🎨](#design-SaraVieira "Design") [πŸ€”](#ideas-SaraVieira "Ideas, Planning, & Feedback") |
52+
| [<img src="https://avatars1.githubusercontent.com/u/23313266?v=4" width="100px;"/><br /><sub><b>ZYSzys</b></sub>](http://zyszys.top)<br />[πŸ“–](https://github.com/CompuIves/codesandbox-client/commits?author=ZYSzys "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1051509?v=4" width="100px;"/><br /><sub><b>Sara Vieira</b></sub>](http://iamsaravieira.com)<br />[πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=SaraVieira "Code") [🎨](#design-SaraVieira "Design") [πŸ€”](#ideas-SaraVieira "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/6137112?v=4" width="100px;"/><br /><sub><b>FranΓ§ois Chalifour</b></sub>](https://francoischalifour.com)<br />[πŸ›](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Afrancoischalifour "Bug reports") [πŸ’»](https://github.com/CompuIves/codesandbox-client/commits?author=francoischalifour "Code") |
5353
<!-- ALL-CONTRIBUTORS-LIST:END -->

β€Žpackages/app/src/sandbox/eval/transpilers/babel/index.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ class BabelTranspiler extends WorkerTranspiler {
7575
const dependencies =
7676
configs.package &&
7777
configs.package.parsed &&
78-
configs.package.parsed.dependencies;
78+
configs.package.parsed.dependencies || {};
7979

8080
const devDependencies =
8181
configs.package &&
8282
configs.package.parsed &&
83-
configs.package.parsed.devDependencies;
83+
configs.package.parsed.devDependencies || {};
8484

8585
const isV7 =
8686
loaderContext.options.isV7 || isBabel7(dependencies, devDependencies);

0 commit comments

Comments
Β (0)