Code Monkey home page Code Monkey logo

Comments (2)

danilowoz avatar danilowoz commented on May 28, 2024 1

Hey @CharcoalStyles, sorry for hearing you've been facing some problems in the Sandpack. But fortunately, I made your sandbox works in the Sandpack 🎉 !

You can check it in this Sandpack https://codesandbox.io/s/mapbox-dependency-wzccy?file=/src/App.js


Why didn't it work in the first place? Unfortunately, we still have some issues when the template tries to load script and link tags in the head, which were your case, more here in #44. So in order to manage this, I added the mapbox as a dependency in the Sandpack component:

      <Sandpack
        template="vanilla"
        customSetup={{
          entry: "index.html",
          dependencies: {
++          "mapbox-gl": "latest"
          }
        }}
        files={{
          "/src/index.js": indexJs,
          "/src/style.css": style,
          "/index.html": indexHtml
        }}
      />

If you have any further questions, do not hesitate to open a new subject.

from sandpack.

CharcoalStyles avatar CharcoalStyles commented on May 28, 2024 1

@danilowoz thanks for the help; I'll be watching #44 closely.

I've used the import of mapbox-gl in another sandpack, but I've got a tutorial that is basic HTML/CSS/JS and I want to have a Sandpack at the end showing all the files in a working demo.
Using the dependencies means adding imports at the start of the JS file, which might confuse some people.

from sandpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.