Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code in terminal not updating #1641

Closed
marcosc90 opened this issue Mar 21, 2019 · 16 comments
Closed

Code in terminal not updating #1641

marcosc90 opened this issue Mar 21, 2019 · 16 comments

Comments

@marcosc90
Copy link

marcosc90 commented Mar 21, 2019

🐛 bug report

Description of the problem

When I update the code on the editor, the code on the terminal is not updated. When creating CLI applications, it's almost impossible to work, because most of the time the changes are not synced correctly.

Is there a way to sync?

image

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

Your Environment

Software Name/Version
Сodesandbox PROD-1553195562-ec6c48980
Browser 72.0.3626.109
Operating System Ubuntu 18.04
@CompuIves
Copy link
Member

That's indeed weird, it should sync automatically. Does your console in the devtools say anything weird?

@lbogdan
Copy link
Contributor

lbogdan commented Mar 21, 2019

Hey @marcosc90 , thanks for your bug report!

This might (or might not) be related to #1455 (see my comment ). Either way, this is clearly not supposed to happen, will take a look at it ASAP!

@marcosc90
Copy link
Author

That's indeed weird, it should sync automatically. Does your console in the devtools say anything weird?

Nothing weird, just a few errors when the page loads, but nothing else. No errors at all when saving, and even after refreshing the page, the file is completely saved, but the terminal is not updating correctly.

Hey @marcosc90 , thanks for your bug report!

This might (or might not) be related to #1455 (see my comment ). Either way, this is clearly not supposed to happen.

You're welcome. I don't know if it's related to that, don't think so, but I do have that issue too, and it doesn't bother me right now. My issue affects me directly since I'm unable to use the platform for CLI scripts.

@marcosc90
Copy link
Author

It's probably related, but nodemon stopped working. The server is not restarting anymore.

@lbogdan
Copy link
Contributor

lbogdan commented Mar 28, 2019

Hey @marcosc90 ,

I can't really replicate this, has it been happening since? If so, do you have a consistent way to trigger it?

@marcosc90
Copy link
Author

It has happened again, but I don't have a consistent way of triggering it. Once the sandbox is is initialized again, everything is synced.

So as a workaround, maybe a button to reinitialize the Sandbox can be added, or just a button to force sync.

I'll update if I find a way to trigger it.

@lbogdan
Copy link
Contributor

lbogdan commented Mar 28, 2019

Yeah, we will add a button that allows restarting the whole container (instead of just the devserver) soon-ish!

Please buzz me as soon as this happens again, if possible; it would be nice to be able to debug it live. Thanks!

@marcosc90
Copy link
Author

Please buzz me as soon as this happens again, if possible; it would be nice to be able to debug it live. Thanks!

@lbogdan It's happening right now, if you give me a way to contact you privately, I can give you the link of the sandbox (It's an unlisted one)

@lbogdan
Copy link
Contributor

lbogdan commented Apr 5, 2019

@marcosc90 Sorry, I was asleep when you commented, we're probably in quite different time zones. For next time, I'm luca.bogdan on Skype.

@lbogdan
Copy link
Contributor

lbogdan commented Apr 8, 2019

Closing this, as I'm pretty sure it's been resolved by #1729 . @marcosc90 feel free to reopen if it's still happening for you.

@lbogdan lbogdan closed this as completed Apr 8, 2019
@lbogdan
Copy link
Contributor

lbogdan commented Apr 8, 2019

@marcosc90 One more thing: before the sync issue happening, did you by any chance get a notification saying "10 updates in less than 2 seconds, disabling file synchronization"?

@bumpewto
Copy link

Hi @lbogdan I have the same sync issue as @marcosc90 with the "10 updates..." notification.

So I managed to reproduce the issue in minimal conditions, and got hit with the notification as soon as I tried to install packages in a subdirectory. From there on, nothing in the editor got updated the via command line.
Here's the link for the sandbox, https://zqlko706ol.sse.codesandbox.io/

Hope this comment is useful for you !

@lbogdan
Copy link
Contributor

lbogdan commented Apr 25, 2019

@bumpewto That's because, for now, we don't support syncing that many files. We honor .gitignore, though (only the one in the sandbox's root folder), so what you'll probably want to do is create one and put whatever you don't want to sync (like node_modules, build folders etc.) in there, e.g.:

#/.gitignore
front/node_modules
workspace/node_modules
# or just "node_modules" which will globally ignore all module folders

@bumpewto
Copy link

Alright that's crystal clear, thank you for your quick answer !

@Lathryx
Copy link

Lathryx commented May 4, 2021

I've been having the same exact issue with files not syncing! I've seen that there's a limit, and I did get the 10 updates in less than 2 seconds, disabling file synchronization error message. I wasn't too far into my new project so instead, I decided to just restart with a new container sandbox since I hadn't found any answers. I had the same problem, even before installing any dependencies!

In my first attempt (sandbox #1), I had run npx create-react-app client, and this is when I got the error message/notification in the bottom righthand corner. I was able to see everything in the terminal window, but I'm not going to do React development through Vim. My other problem was seeing the files synchronized in other sandboxes with the same thing, like this one. Moving on, during my second attempt (sandbox #2), all I had done is start a new Node HTTP Server sandbox (which is what I had used beforehand with sandbox #1), delete the src directory, and run npm init. The changes can be seen in the terminal window, but the files are still not synced, even in a completely new container sandbox!

I really enjoy using CSB for my React development! However, this is hindering my ability to do so. What should I do?
Note: I also noticed that, in sandbox #1, after running npx create-react-app client, the package.json inside of ./client/src/ seemed to be missing things like its dependency array, scripts (the one currently there was added by me), etc. Not sure if this is related or not, but worth mentioning! Any reason for this?

@FossPrime
Copy link

FossPrime commented Jul 13, 2021

I encountered this problem in the Vue 3 templates. Nodemon is installed on a parent container and will run with yarn, ignoring what's on your package.json. To good news is it will respect .gitignore, AFTER a server restart.

This .gitignore managed to not trip the limiter on a vue create run.

node_modules/
.codesandbox/
ignore-*

Update: I still managed to trip the limiter on a vue create overwrite. Perhaps I should have tried renaming it to something like... ignore-me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants