sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Console not working on static template

Open KenanYusuf opened this issue 1 year ago • 3 comments

Bug report

Packages affected

  • [x] sandpack-client
  • [x] sandpack-react

Description of the problem

The Sandpack console does not appear to be working with static templates.

What were you doing when the problem occurred?

I am using the Sandpack React component with a static template to render some HTML and JavaScript. I am loading a script with a console.log which I would expect to show up in the console.

What steps can we take to reproduce the problem?

Here's a CodeSandbox with a replication of the issue.

Your Environment

Software Name/Version
Sandpack-client version 2.6.0
Sandpack-react version 2.6.0
Browser
Operating System

KenanYusuf avatar Apr 15 '23 15:04 KenanYusuf

I have added your feature request to our internal backlog which we use to prioritize what to build next. We can't make any promises about the timing, but it's on the list!

For others landing on this issue, feel free to add more context or simply leave a thumbs up 👍 on this comment if you find this feature useful.

danilowoz avatar May 19 '23 14:05 danilowoz

Thanks @danilowoz - appreciate it. If I can just add a little more context:

I am using Sandpack to create a basic code playground, where users can write HTML, CSS and JavaScript. Being able to present console messages to users in the UI, similar to how CodeSandbox do it, would be super helpful.

FWIW, I logged this as a bug rather than a feature request because it doesn't mention anywhere that the sandpack console will not work with the static template - I can create a PR that adds some messaging around this on the docs if that would be useful?

KenanYusuf avatar May 23 '23 06:05 KenanYusuf

Hey, @KenanYusuf. Thanks for the further information. I believe adding a limitation message on the documentation sounds like a wise change. Can you open a PR for that?

danilowoz avatar May 23 '23 07:05 danilowoz