Codesandbox-client: Console log persists even after switching sandbox.

Created on 3 Oct 2019  路  7Comments  路  Source: codesandbox/codesandbox-client

馃悰 bug report

Description of the problem

  • Created a new sandbox in a folder.
  • The previous sandbox console logged some stuff.
  • As soon as I begin writing in the new sandbox's js file the console logged stuff of the previous sandbox appears.
  • It goes away as soon as I reload the browser in the sandbox
  • It reappears as soon as I type something and the JS file is unsaved.

This is happening with Vanilla JS sandbox for me I haven't tried out other sandboxed templates.

How has this issue affected you? What are you trying to accomplish?

It confuses me a lot.

Link to sandbox: link (optional)

Previous sandbox

The sandbox I'm currently working with.

Your Environment

| Software | Name/Version |
| ---------------- | ------------ |
| 小odesandbox |
| Browser - Firefox 69.0.1 (64 Bit) |
| Operating System - Windows 10|

Here's a screenshot.
I would like to work on the issue, also I'm new here, this is my first time contributing to something technical. Thank You for looking into this.
image

馃悰 Bug

All 7 comments

Hey @yashguptaz! This is a good report, we would absolutely appreciate your help! We normally clear the console with this code: dispatch({ type: 'clear-console' });. We could add this code here I think: https://github.com/CompuIves/codesandbox-client/blob/d15f9e7c51f159ab429002a577cbfd3de43f27a7/packages/common/src/components/Preview/index.tsx#L240-L263 to fix it.

I have set up my project locally, I have made the required changes but I cannot test them.
I don't know why this is happening.

image

Can you tell me how can I log in to codesandbox using GitHub?
I want to test this thing with folders but I'm unable to create folders because I cannot log in.

image

I have added dispatch({ type: 'clear-console' }); just after the resetState() function at line 244.
I hope it should be good.
I haven't run any tests yet, I will update you once I try out my changes and will test this thing after that.

I am having some issues with Yarn test
@Saeris @CompuIves Can you help me with that?

TptI9162 png medium

Hey @yashguptaz
For testing login features you can do the following:

You can log in on https://codesandbox.io/ and copy the contents of the jwt local storage key over to your development environment on http://localhost:3000/.

Read the last paragraph here for more details.

@CompuIves I cannot replicate the bug now, was there a patch that fixed that?
I find it strange. If there was a PR that fixed it I'm closing this issue and my PR.

@yashguptaz, I believe that your PR fixed it. Can you close the issue, please?

Closing it right now :)
Will be looking forward to more contributions from my side.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oliversturm picture oliversturm  路  3Comments

supersonicclay picture supersonicclay  路  3Comments

k15a picture k15a  路  3Comments

MarcelloTheArcane picture MarcelloTheArcane  路  3Comments

wojciechczerniak picture wojciechczerniak  路  3Comments