sandpack
sandpack copied to clipboard
Three.js addons cannot be imported via `three/addons/*`
Bug report
Packages affected
- [ ] sandpack-client
- [ ] sandpack-react
Description of the problem
From the Three.js docs, we should import examples from three/addons/* instead of three/examples/jsm/*. But, Sandpack bundler (non-experimental, not yet tested on the new bundler) cannot resolve exports property in the package.json. Here is the exports config of Three.js package:
{
"name": "three",
...
"exports": {
".": {
"import": "./build/three.module.js",
"require": "./build/three.cjs"
},
"./examples/fonts/*": "./examples/fonts/*",
"./examples/jsm/*": "./examples/jsm/*",
"./addons/*": "./examples/jsm/*",
"./src/*": "./src/*",
"./nodes": "./examples/jsm/nodes/Nodes.js"
},
...
}
What were you doing when the problem occurred?
The problem happens on code load.
What steps can we take to reproduce the problem?
The problem happens on code load.
Link to sandbox: sandbox
Your Environment
| Software | Name/Version |
|---|---|
| Sandpack-client version | |
| Sandpack-react version | 2.0.6 |
| Browser | Chrome 110 |
| Operating System | Fedora 37 |
@DeMoorJasper, could you please take a look at this issue? If you confirm it's a real problem on our side, we can prioritize and address it depending on how urgent it is.
It works on vite template! The problem seems to be on non-nodebox runtime.