codesandbox / sandpack

A component toolkit for creating live-running code editing experiences, using the power of CodeSandbox.
https://sandpack.codesandbox.io
Apache License 2.0
4.7k stars 330 forks source link

Issue with pulling dependencies for babel plugin "proposal-decorators" #890

Open Phazia opened 1 year ago

Phazia commented 1 year ago

Bug report

Getting the following issue when trying to run a medium-sized project in Sandpack: Could not find/install babel plugin 'proposal-decorators': Cannot find plugin 'proposal-decorators' or 'babel-plugin-proposal-decorators'

The error logs also had some issues fetching packages concerning "babel-plugin-syntax-dynamic-import" and "babel-plugin-transform-modules-commonjs"

Searching on StackOverflow led me to find one post about SVGs not working in Sandboxes, but I'm not sure if that's true or not.

Packages affected

Description of the problem

Unable to run a project in sandpack due to this error: Could not find/install babel plugin 'proposal-decorators': Cannot find plugin 'proposal-decorators' or 'babel-plugin-proposal-decorators. The project source code is private, but the dependencies are as follows: "dependencies": { "@codemirror/autocomplete": "^6.3.0", "@codemirror/lang-javascript": "^6.1.1", "@codemirror/lang-json": "^6.0.1", "@codemirror/legacy-modes": "^6.3.1", "@codemirror/lint": "^6.1.0", "@emotion/styled": "^11.9.3", "@lezer/highlight": "^1.1.2", "@lottiefiles/lottie-player": "^1.5.4", "@mui/icons-material": "^5.8.4", "@mui/lab": "^5.0.0-alpha.90", "@mui/material": "^5.8.7", "@radix-ui/react-dialog": "^1.0.2", "@radix-ui/react-dropdown-menu": "^2.0.1", "@radix-ui/react-hover-card": "^1.0.2", "@radix-ui/react-icons": "^1.0.3", "@radix-ui/react-popover": "^1.0.2", "@radix-ui/react-slider": "^1.0.0", "@reduxjs/toolkit": "^1.8.3", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", "@types/jest": "^27.4.1", "@types/node": "^17.0.21", "@types/react": "^17.0.39", "@types/react-dom": "^17.0.13", "@uiw/codemirror-themes": "^4.13.2", "@uiw/react-codemirror": "^4.13.0", "airtable": "^0.10.1", "dnd-kit-sortable-tree": "^0.1.50", "express": "^4.17.1", "file-saver": "^2.0.5", "firebase": "^7.24.0", "firebase-admin": "^9.9.0", "fractional-indexing": "^2.0.0", "jquery": "^3.6.0", "jquery-ui": "^1.13.2", "jszip": "^3.10.1", "pixi.js": "^7.1.0", "prism-react-renderer": "^1.2.1", "prismjs": "^1.25.0", "protobufjs": "^7.1.2", "react": "^18.2.0", "react-color": "^2.19.3", "react-dom": "^18.2.0", "react-draggable": "^4.4.4", "react-rnd": "^10.3.7", "react-scripts": "^5.0.1", "react-select": ">=5.4.0", "redux": "^4.1.0", "styled-components": "^5.3.0", "typescript": "^4.6.2", "util": "^0.12.4", "uuid": "^8.3.2", "validator": "^13.7.0"

Since the dependencies don't mention the babel plugin, I'm not sure if its an issue with the project formatting or the packager.

What were you doing when the problem occurred?

Calling update on a sandpack client.

What steps can we take to reproduce the problem?

Unsure. Will update this post if I can find a minimum example for what's causing this to occur.

Your Environment

Software Name/Version
Sandpack-client version ^2.2.9
Sandpack-react version ^2.2.9
Browser 111.0.5563.146
Operating System macOS Version 13.2.1
danilowoz commented 1 year ago

Hey, could you please provide a minimal sandbox to reproduce this error?

Thanks

mantou132 commented 3 weeks ago

How should sandpck-client be configured to use the Stage 3 decorators?