Comments (2)
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.
@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)
- Vanilla and Static templates rendering twice on initial load HOT 1
- SandpackTests load forever when autoReload is false and you Run code before running tests HOT 1
- Doesn't work with NextJS 13.5.2 HOT 3
- Attempted import error: 'Annotation' is not exported from '@codemirror/state'. HOT 3
- Property description must be an object: undefined
- Does the sandpack provider reset on mount of new Sandpack components? HOT 2
- I've tried again many times, and it still won't display the results. HOT 3
- closableTabs prop does not work for FileEditor
- showOpenInCodeSandbox not working HOT 1
- An error of svelte/store and lifecycle in svelte template at official demo
- Unable to preview changes on the sandbox created
- Make it possible to hide the default "clear" button in SandpackConsole
- Editor hangs when useEffect has no dependency specifed
- Vite template not working with specific dependency
- `<head>` is being replaced inside of React projects HOT 1
- I am using sandpack and i am not able to see my code is formatted, so is there any way to achieve this?? HOT 3
- Option to derive the `activeFile` via a URL param HOT 2
- Sandpack Preview fails to load after scroll.
- Issues when Sandpack times out after initial error
- Trivial example does not work with next.js HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sandpack.