sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Add Solid Babel transform dependency

Open joshpoll opened this issue 1 year ago • 3 comments

What kind of change does this pull request introduce?

Bug fix

What is the current behavior?

The current Solid template fails to run correctly:

https://sandpack.codesandbox.io/docs/getting-started/usage

Screen Shot 2023-07-06 at 11 30 11 AM
Something went wrong

/App.tsx: _tmpl$ is not a function (4:2)

  1 | import { Component } from "solid-js";
  2 | 
  3 | const App: Component = () => {
> 4 |   return <h1>Hello world</h1>
        ^
  5 | };
  6 | 
  7 | export default App;

What is the new behavior?

The template should be fixed

What steps did you take to test this? This is required before we can merge, make sure to test the flow you've updated.

I'm not sure how to test this! I've run it in a separate code sandbox and that worked. It also matches the dependencies in Ryan Carniato's example sandbox: https://codesandbox.io/s/solid-hello-world-9v13b

Checklist

  • [ ] Documentation; N/A
  • [ ] Storybook (if applicable); N/A
  • [ ] Tests;
  • [ ] Ready to be merged;

joshpoll avatar Jul 06 '23 15:07 joshpoll

@joshpoll is attempting to deploy a commit to the CodeSandbox Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jul 06 '23 15:07 vercel[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b1165b0d8b4c4e45587b8e1cad120e0e0e0a724d:

Sandbox Source
Sandpack Configuration
sandpack-run-stale-value Configuration
Solid Hello World PR

codesandbox-ci[bot] avatar Jul 06 '23 15:07 codesandbox-ci[bot]

I noticed that there is a .babelrc file in Ryan Carniato's example. However, in sandpack it doesn't seem to be necessary for some reason. Additionally, it actually seems to break the current version when I run it like this:

<Sandpack
  template="solid"
  files={{
    "/.babelrc": {
      code: `{
  "presets": [
    "babel-preset-solid"
  ]
}`,
    },
  }}
  customSetup={{
    dependencies: {
      "babel-preset-solid": "1.6.16",
    },
  }}
/>
Screen Shot 2023-07-06 at 11 59 44 AM

Without .babelrc things seem to work fine.

joshpoll avatar Jul 06 '23 16:07 joshpoll