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

Invalid left-hand side in assignment #1117

Closed
1 of 2 tasks
alexdanilowicz opened this issue Apr 11, 2024 · 1 comment
Closed
1 of 2 tasks

Invalid left-hand side in assignment #1117

alexdanilowicz opened this issue Apr 11, 2024 · 1 comment
Labels
bug Something isn't working triage New issues that needs consideration

Comments

@alexdanilowicz
Copy link

Bug report

@danilowoz — first off, great name. Almost had to do a double take. Not many of us! ;)

Great package too, although it appears between now and ~February, Invalid left-hand side in assignment is returned when trying to run the below minimally reproducible example.

I know it wasn't a problem on Feb 8 because we were not experiencing this bug and you can currently see this bug on the Chakra UI homepage (which certainly was not showing on Feb 8): https://chakra-ui.com/

CleanShot 2024-04-10 at 23 35 26@2x (2)

Packages affected

  • sandpack-client
  • sandpack-react

Description of the problem

I have no reason to believe this is exclusively a Charka issue, but that's what I was trying to run and no matter what I get Invalid left-hand side in assignment.

I believe this might be related to #1114 because it also makes the page unresponsive after some time, lot of re-rendering happening.

Code Snippet:

"use client";
import { Sandpack } from "@codesandbox/sandpack-react";

const App = () => {
  const files = {
    "App.tsx": `import React from "react";
import * as ReactDOM from "react-dom/client";
import { ChakraProvider, Button} from "@chakra-ui/react";

const HelloWorld = () => {
  return (
    <Button>Hi</Button>)
}

const rootElement = document.getElementById("root");
ReactDOM.createRoot(rootElement).render(
  <ChakraProvider>
    <App />
  </ChakraProvider>
);`,
  };

  return (
    <Sandpack
      files={files}
      template="react-ts"
      options={{ editorHeight: "400px" }}
      customSetup={{
        dependencies: {
          "@chakra-ui/react": "latest",
          "@chakra-ui/icons": "latest",
          "@emotion/react": "latest",
          "@emotion/styled": "latest",
          "framer-motion": "latest",
          react: "latest",
          "react-dom": "latest",
          "react-scripts": "latest",
        },
        devDependencies: {
          "@types/react": "latest",
          "@types/react-dom": "latest",
          typescript: "latest",
        },
      }}
    />
  );
};

export default App;

What were you doing when the problem occurred?

Trying to render App.tsx with the above.

What steps can we take to reproduce the problem?

Reproducible example in this repo: https://github.com/alexdanilowicz/repo-sandpack/blob/main/src/app/page.tsx

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Sandpack-client version
Sandpack-react version 2.13.7 , it appears ^2.12.0 has the same problem
Browser Chrome
Operating System MacOS
@alexdanilowicz alexdanilowicz added bug Something isn't working triage New issues that needs consideration labels Apr 11, 2024
@alexdanilowicz
Copy link
Author

Closing. Resolved by #1118. #1118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that needs consideration
Projects
None yet
Development

No branches or pull requests

1 participant