codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

Chrome Errors in project preview "TypeError Could not fetch dependencies, please try again in a couple seconds"

Open akutruff opened this issue 2 years ago • 13 comments

🐛 bug report

Edit: updated link to reflect new location:

Preflight Checklist

  • [x] I have read the Contributing Guidelines for this project.
  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Description of the problem

Under Chrome, the sandbox located here produces an error in the embedded browser:

https://codesandbox.io/s/github/akutruff/diagon/tree/master/apps/demo

Firefox works fine.

TypeError
Could not fetch dependencies, please try again in a couple seconds: Cannot read properties of null (reading 'match')
s
https://codesandbox.io/static/js/sandbox.11a2ae9a6.js:1:138474
(anonymous function)
https://codesandbox.io/static/js/sandbox.11a2ae9a6.js:1:170761
i
https://codesandbox.io/static/js/sandbox.11a2ae9a6.js:1:167040

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

Project broken in chrome.

To Reproduce

Go to sandbox here: https://codesandbox.io/s/github/akutruff/diagon/tree/master/apps/demo and try to see the app. If you copy the embedded preview url into a new browser tab, the error will also occur. If you "empty cache and hard reload" on the tab with the preview url, it will actually work once. If you refresh that page again, the error occurs again. "empty cache and hard reload" on the full sandbox does not fix the problem.

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Сodesandbox latest
Browser Chrome
Operating System Windows

akutruff avatar Aug 11 '22 17:08 akutruff

Hey! I cannot seem to repro this issue, are you still experiencing this? image

I've seen before that an adblocker could prevent some dependencies from being downloaded. Could that maybe be it?

CompuIves avatar Aug 15 '22 19:08 CompuIves

Yeah, unfortunately. It's super weird. Perhaps try refreshing the page a lot, or opening it other browsers? It worked fine until I I set new NPM versions for the dependencies.

akutruff avatar Aug 15 '22 19:08 akutruff

image

akutruff avatar Aug 15 '22 19:08 akutruff

I can confirm the exact same issue, but in my case it takes a long time to install the dependencies, sometimes it will throw the same error and sometimes it will render the app but that is when it takes a long time to install them. image

And after it install babel it will throw this error image

No matter which version of NPM I choose, it takes a long time to compile a project.

Ubuntu 22.04 Tried on all my browsers edge, chrome, firefox and the issue is the same.

wilsoft-gt avatar Aug 17 '22 03:08 wilsoft-gt

Hey @wilsoft-gt - I've just opened the URL in your screenshot and it's loading perfectly.

Out of interest, do you have a device with a different operating system that you could try it on?

JamesACS avatar Aug 19 '22 10:08 JamesACS

@JamesACS I disabled all ad blocking and its still happening for me.

Now, I'm getting CORS errors when referencing my packages as well.

image

akutruff avatar Aug 19 '22 14:08 akutruff

It's still loading fine for us @akutruff , are you using incognito mode?

As above, have you also tried to load it using a browser on a different operating system?

JamesACS avatar Aug 19 '22 15:08 JamesACS

Hey @wilsoft-gt - I've just opened the URL in your screenshot and it's loading perfectly.

Out of interest, do you have a device with a different operating system that you could try it on?

Yes, it is working fine in other OS, it seems that the issue is somewhere in ubuntu but can't find anything related to this anywhere. I check the network and restarted the page and this is what I'm getting, not sure if this is related to the container and ubuntu 22.04 or what. Half a minute trying to fetch babel core and babel runtime and other dependencies are marked as red as well.

image

wilsoft-gt avatar Aug 20 '22 19:08 wilsoft-gt

@JamesACS

Nope, normal mode. It will work in incognito mode sometimes.

akutruff avatar Aug 29 '22 15:08 akutruff

@JamesACS updated link to sandbox

Also, here's it running on stackblitz without error: https://stackblitz.com/github/akutruff/diagon/tree/master/apps/demo

akutruff avatar Aug 30 '22 12:08 akutruff

Hi, I have a similar issue and I am using a mac. Link to the code sandbox is here [https://codesandbox.io/s/8te0rv?module=/example.js&file=/package.json] I updated the package version to Newskit 6.3.0 as shown in the sandbox, originally the version was 'unstable' it worked fine with 'unstable' as soon as I changed the version I got the same error of not being able to fetch. I tried it incognito and on safari (I am currently using chrome) and it does not work. I was wondering if anyone has any advice? Screenshot 2022-10-20 at 13 19 17

baburay23 avatar Oct 20 '22 12:10 baburay23

I'm experiencing the same issue (Intel Mac + Chrome-based browsers; Firefox is fine) and I see from previous discussions that this has been a persistent problem for at least a year. @baburay23 and @akutruff , were either of you able to discover a workaround or potential solution?

EDIT: In my case it sometimes works if I don't set expanddevtools=1 (which I need). When I set expanddevtools=1, then it never works.

EDIT2: I also observerd it works on incognito, but it does not work on the normal Site even if I remove all cookies and local storage...

landabaso avatar Jul 14 '23 16:07 landabaso

Ok, I managed to make it work. In my case I was trying to embed a github project. I read from other users that adding a tag could fix it. And, it worked... I have the feeling that creating a new tag solves some kind of wrongly cached issue.

landabaso avatar Jul 14 '23 17:07 landabaso