Codesandbox detects loop iterating more than 10000 times at import
y-nk opened this issue · comments
Julien Barbay commented
Reproducible example: https://codesandbox.io/s/mutable-brook-7r4tru?file=/src/App.js
Steps to reproduce:
- Create a sandbox with CRA template
- Install @kodemo/player
- Export the sample story from the kodemo editor as a json file
- Feed the player from 2. with the story from 3. It should give something like:
import React from "react"; import "./App.css"; import { KodemoPlayer } from "@kodemo/player"; // ← breaks here import json from "./story.json"; function App() { return ( <div className="App"> {/*<KodemoPlayer json={json} />*/} // ← nothing rendered here </div> ); } export default App;
Current result:
Current fix:
You can remove this check by creating a sandbox.config.json
and add "infiniteLoopProtection": false
and it works... although i'm thinking something's not right to have 10k loop iteration on import.
Expected result:
I'm thinking importing a module should not directly execute code. I'm not really sure if it's a codesandbox issue or a kodemo issue, but there's definitely something worth reporting.