-
May I request any basic pointers to get this running with Vite. node_modules/.vite/deps". The package may have incorrect main/module/exports specified in its package.json. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
Failed to resolve entry for package "/Users/XXXXXXXXXX/node_modules/.vite/deps". The package may have incorrect main/module/exports specified in its package.json. I just tried to import from "manifold-3d" |
Beta Was this translation helpful? Give feedback.
-
Well, I've never used Sveltekit, but we use Vite internally for ManifoldCAD.org: https://github.com/elalish/manifold/blob/master/bindings/wasm/examples/vite.config.js manifold-3d doesn't have any dependencies, so I'm guessing that error is coming from further up in your stack. |
Beta Was this translation helpful? Give feedback.
-
So one thing I am trying to do is, trying to at least on the browser side, load the file via a fetch call. I have used this when I compile to a wasm file. So far I can instantiate it, in a hacky way. But I am not able to get the equivalent of a wasm.setup() call when I do this.
|
Beta Was this translation helpful? Give feedback.
-
Try this import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
optimizeDeps: {
// disable optimization for manifold, it does not work for unknown reason
exclude: ['manifold-3d'],
},
}); And just use the import Module from 'manifold-3d';
Module().then((manifold) => {
manifold.setup();
console.log(manifold);
}) I've tested it on a clean SvelteKit app created by |
Beta Was this translation helpful? Give feedback.
Failed to resolve entry for package "/Users/XXXXXXXXXX/node_modules/.vite/deps". The package may have incorrect main/module/exports specified in its package.json.
I just tried to import from "manifold-3d"
Using Sveltekit