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.
Questions tagged [codesandbox]
276 questions
3
votes
1 answer
CodeSandbox — How to fix tsserver.js errors?
I am currently getting two error in CodeSandbox every time I refresh or start a new Sandbox. I tried many things to solve without success. Has anyone come across this and managed to fix it?
Error
VS Code's tsserver was deleted by another…

Diego Oriani
- 1,647
- 5
- 22
- 31
3
votes
1 answer
It's not working in CodeSandbox but runs in visual studio code. why?
Here is the code that I am using.
JS
const clockContainer = document.querySelector('.js-clock'),
clockTitle = clockContainer.querySelector('h1');
function getTime() {
const date = new Date();
const minutes = date.getMinutes();
…

badbeoti
- 33
- 3
3
votes
1 answer
How can I use scripts in a static codesandbox template?
I have created a static codesandbox template, but can't seem to get javascript working:
Just a test
…
Kokodoko
- 26,167
- 33
- 120
- 197
3
votes
2 answers
Why I get this error (new Set(...)).slice is not a function?
I tried to run this code in any of the online code editors but I always get error
(new Set(...)).slice is not a function
Code:
myarray = ['d','s', 'a'];
chr_arr = [...new Set(myarray)];
why I get this error ?

zac
- 4,495
- 15
- 62
- 127
3
votes
1 answer
Running in-browser development server [like stackblitz/codesandbox]
The Question:
How to run a live in-browser dev server?
Context
Stackblitz and CodeSandbox are two platforms that provide online IDE to develop web applications. I have a similar use case, and would need to run an in browser dev server, but there's…

Nishkal Kashyap
- 960
- 7
- 17
3
votes
3 answers
Http request error with codeSandBox (React/Node)
I have strange error in online IDE like CodeSandBox/StackBlitz.
I do a sample http request (with axios but with fetch or others the problem is the same) and try to print the response in the console.
I use React for the front and node (listen port…

sayenel
- 31
- 4
2
votes
0 answers
How to style `Sandpack`
Overview
I'm looking for the best practice when styling sandpack, I know there's the @codesandbox/sandpack/unstyled export, however this isn't a viable choice because they aren't modular enough to be interoperable with the regular styled exports. I…

SaintPreston
- 103
- 6
2
votes
2 answers
How to export Codesandbox project?
I can't seem to figure out why I can't download the project from Codesandbox. When I click on my project, I am redirected to this screen. Here I am working on my project but I don't see an option to export or download the project files. I have…

Ali Mustafa
- 676
- 3
- 14
2
votes
0 answers
findLast and findLastIndex not working / existing in codesandbox
In codesandbox for example [1,2,3].findLastIndex(n => n === 2) has an error saying that the method findLastIndex (I've checked and the same is true for findLast) does not exist on a number array. I've tried the same with other types of arrays and…

The Truth
- 87
- 11
2
votes
1 answer
Vue3 Codesandbox unexpected token using
I am running into the following error:
/src/components/Screen.vue: Unexpected token (9:6)
But I'm unable to see any sort of issue that could be causing this:
https://codesandbox.io/s/gifted-pond-5b9lfe?file=/src/components/Screen.vue
My Screen.vue…

Djave
- 8,595
- 8
- 70
- 124
2
votes
0 answers
Is vscode.dev open source? What is different between monaco-editor and vscode.dev
I wanna create a website similar to https://codesandbox.io, as I see (thru google chrome dev tools) it used internally monaco-editor, but also it has files structure navigation, tabs and so on, so its more similar to https://vscode.dev, I have tried…

knotri
- 223
- 2
- 15
2
votes
1 answer
Sveltekit: Cannot find module 'swiper'
I tried the sveltekit-swiper example from
https://swiperjs.com/svelte
08:07:51 [vite] Error when evaluating SSR module /src/routes/s.svelte: Error: Cannot find module 'swiper' from 'C:/Svelte/tw09swipe/src/routes'
at Function.resolveSync [as…

Martin Weissenboeck
- 683
- 3
- 8
- 22
2
votes
0 answers
Webpack config doing nothing in codesandbox project
I've created this codesandbox example which has a webpack.config.js and has webpack/webpack-cli/webpack-dev-server installed as dependencies. Except it's not being used. I can delete a random part of the config so that it shouldn't run/compile, but…

ABC
- 693
- 1
- 10
- 22
2
votes
2 answers
Switch tab in CodeSandbox, shortcut key / hotkey
I was using CodeSandbox to test JavaScript codes in my browser fast. And tried hard to get the key to switch tabs, but I couldn't. I tried Ctrl+Tab But it would rather switch the browser tabs.
So what is the hotkey to switch tabs? if there is no…

Abraham
- 12,140
- 4
- 56
- 92
2
votes
1 answer
How do you run a script in CodeSandBox?
I have a simple app.js file in codesandbox.
Normally in VSCode with nodejs installed, I can just run node app and the file runs
How can I do the same on codesandbox?

wongz
- 3,255
- 2
- 28
- 55