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

CodeSandbox broken #512

Closed
dwelle opened this issue Jan 22, 2020 · 8 comments
Closed

CodeSandbox broken #512

dwelle opened this issue Jan 22, 2020 · 8 comments
Labels
bug

Comments

@dwelle
Copy link
Collaborator

@dwelle dwelle commented Jan 22, 2020

It seems that #510 broke CodeSandbox (it works on the preceding commit).

https://codesandbox.io/s/github/excalidraw/excalidraw

image

Haven't investigated further, so not sure what exactly is the problem.

/cc @tomayac

@dwelle dwelle added the bug label Jan 22, 2020
@tomayac

This comment has been minimized.

Copy link
Collaborator

@tomayac tomayac commented Jan 22, 2020

I'm very sorry 😔. I just cloned and deployed on Glitch, and there it works fine (apart from an unrelated ws:// mixed content error when loaded over https).

I'm not sure what CodeSandbox does differently. Does anyone know how to debug?

@tomayac

This comment has been minimized.

Copy link
Collaborator

@tomayac tomayac commented Jan 22, 2020

OK, I traced this down. In browser-nativefs, I use a dynamic import to load either the legacy file handling approach, or the Native File System API (deep link).

If you look at the deployed version, this is the source tree (note the presence of file-save-nativefs.mjs and file-open-nativefs.mjs):

Screen Shot 2020-01-22 at 16 33 28

If you compare to CodeSandbox's version, the dynamically imported files are missing:

Screen Shot 2020-01-22 at 16 33 42

I will open an Issue with CodeSandbox.

Update: this is a known issue with CodeSandbox: codesandbox/codesandbox-client#1887.

@dwelle

This comment has been minimized.

Copy link
Collaborator Author

@dwelle dwelle commented Jan 22, 2020

Mhm... I'm not sure if the dynamic import itself is the problem, because I've manually tried it out and it works (check https://codesandbox.io/s/floral-lake-ou5wi index.tsx:201).

It may be a problem with CodeSandbox & dynamically importing/resolving mjs files, or it may be connected with CodeSandbox & Create-react-app bundler integration issues (which there were many).

🤔

@tomayac

This comment has been minimized.

Copy link
Collaborator

@tomayac tomayac commented Jan 22, 2020

Another theory is that it's codesandbox/codesandbox-client#1774.

@dwelle

This comment has been minimized.

Copy link
Collaborator Author

@dwelle dwelle commented Jan 22, 2020

That's feels more like it 👍.

@tomayac

This comment has been minimized.

Copy link
Collaborator

@tomayac tomayac commented Jan 23, 2020

This successfully loads in CodeSandbox after #523 was merged, but now the file opening/saving is broken and throws a console error. It works on Excalidraw.com. ¯\(ツ)

@dwelle

This comment has been minimized.

Copy link
Collaborator Author

@dwelle dwelle commented Jan 23, 2020

As I understand, it only throws on CSB? IMO that's an acceptable compromise (/cc @vjeux), as CSB will be used only for quick & dirty development.

I'll close this for now. Let's see if anyone comes to complain :).

Thanks for working on this!

@dwelle dwelle closed this Jan 23, 2020
@vjeux

This comment has been minimized.

Copy link
Collaborator

@vjeux vjeux commented Jan 23, 2020

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.