Questions tagged [codesandbox]

Codesandbox.io is an open-source online code editor supporting vanilla JS, Vue.js, Angular.js, React.js, and Preact.js. DO NOT use this tag just because your code is hosted on CodeSandbox, and your problem is otherwise unrelated to the CodeSandbox site.

276 questions
4
votes
3 answers

Removing a codesandbox.io sandbox

I have create several sandboxes that are no longer of use and are cluttering up my dashboard. I would like to remove these sandboxes. How can I remove a sandbox?
Kevin Burton
  • 2,032
  • 4
  • 26
  • 43
4
votes
1 answer

CodeSandBox: Angular: ERROR TypeError: html2canvas_1.default is not a function

My project should convert a simple html table to PDF. But I get this errors on CodeSandbox: ERROR TypeError: html2canvas_1.default is not a function at AppComponent.downloadPDF (https://3d3bh.csb.app/src/app/app.component.ts:66:30) at new…
user12504785
4
votes
4 answers

Cannot Edit in read only editor Codesandbox

I am trying to use codesandbox by importing the github repository. I am not able to edit the contents of the package.json file. It says cannot edit in ready only editor. How to solve this error?
Jay Rajput
  • 71
  • 2
  • 3
4
votes
3 answers

How to disable special handling of SVG imports in codesandbox?

I've created a simple app with create-react-app. This configures webpack loaders for svg files to copy the files and put a public file into the constant. So the following code import mysvg from "./img/my.svg"; console.log(mysvg) prints…
Christian
  • 13,285
  • 2
  • 32
  • 49
4
votes
1 answer

Error running tests - jest.mock is not a function

I am trying to run tests using Jest, however I am getting this error: jest.mock is not a function What am I doing wrong? Here's my CodeSandbox: https://codesandbox.io/s/polling-hook-demo-9yo8c Note that I am configuring Jest inside my…
Naresh
  • 23,937
  • 33
  • 132
  • 204
3
votes
1 answer

'this' context different for event handlers in function vs class react components

Why is 'this' (the context) different depending on whether I use a functional or class component in react? I understand how binding works and that my handler will take on the context of the onclick handler (or however it gets used in onclick) but I…
Sendai
  • 1,625
  • 2
  • 8
  • 14
3
votes
2 answers

Importing @apollo/client in CodeSandbox, getting TypeError Cannot read properties of undefined (reading 'FIELD')

Basically as the title says, I'm creating a React app in CodeSandbox and installing Apollo/Client as a dependency to link to my back end GraphQl. After I add it as a dependency, I try and import it to my index.js, but I get a "Type Error Cannot Read…
andy123
  • 31
  • 1
  • 2
3
votes
0 answers

Getting hot reload to work in a codesandbox node environment

I've created a codesandbox project that runs both frontend and backend using concurrently - it all works great, but I can't get react-scripts hot reload functionality to work. That means that every time I change my tsx file - I need to manually…
Noam
  • 4,472
  • 5
  • 30
  • 47
3
votes
1 answer

Why Codesandbox can't render the code and show strange error

I learn JavaScript and read code at this Codesandbox Problem is it gives this error often on some Sandbpxes: NoSuchMethodError: method not found: 'write$1' on null It looks like this; What can I do to remove this error?
Kid
  • 1,869
  • 3
  • 19
  • 48
3
votes
1 answer

React Search title result and Pagination Material UI

I am able to retrieve a list of data and search for a title name from a list of todos This is the prototype i have done => https://codesandbox.io/s/silly-firefly-7oe25 In the demo you can see the 2 working cases in App.js
Koala7
  • 1,340
  • 7
  • 41
  • 83
3
votes
3 answers

reactjs error - onChange is not a function error

I have created a field array with file input and a text field. Everything seems to works fine but when I try to upload a small image or typing something in the textfield, a Type error pops up with "onChange is not a function" message. How do I fix…
jch02140
  • 45
  • 1
  • 6
3
votes
2 answers

Stop Codesandbox from auto-updating the preview on file change

How can I make Codesandbox stop updating the browser preview while I type? I turned off auto save in VS Code, but still Codesandbox updates the preview pane instantly, all the time, showing long lists of syntax errors while I'm working on the code.
potatoDie
  • 71
  • 6
3
votes
1 answer

How to run an application in codesandbox with different subfolder for backend and frontend

I want to get a codesandbox for an app I am working on. How do I make the project work with two different subfolders named backend and frontend? How can that be done? I am sending for you my packages.json file content: { "name":…
lucasbbs
  • 349
  • 4
  • 14
3
votes
1 answer

(Codesandbox, Vue) 'Property or method "children" is not defined on the instance but referenced during render.'

I am currently building a State Manager, which can be integrated into multiple Frontend Framework, including Vue. To demonstrate the usage of the State Manger in Vue, I created a simple codesandbox. Because it is always nice to have a live code…
BennoDev
  • 1,067
  • 1
  • 6
  • 17
3
votes
2 answers

The code is working fine in codeSandbox, But showing error while doing in the IDE as "can't define property "email": Object is not extensible"

I am trying to implement a simple code in react.js which user can input the data using form and unless the page is refreshed the data will show in the table. I have implemented a code in Code Sandbox and it worked as expected. Then I copied that…
Deepika
  • 737
  • 7
  • 23
1
2
3
18 19