Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix threlte bundling configuration #9

Merged
merged 3 commits into from
Oct 19, 2023
Merged

Fix threlte bundling configuration #9

merged 3 commits into from
Oct 19, 2023

Conversation

franknoirot
Copy link
Collaborator

After my last PR, the Vercel deploy started having crashing issues, where on page load server-side the following error would occur:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/node_modules/three/examples/jsm/loaders/DRACOLoader' imported from /var/task/.svelte-kit/output/server/chunks/ModelPreviewer.js
    at new NodeError (node:internal/errors:405:5)
    at finalizeResolution (node:internal/modules/esm/resolve:329:11)
    at moduleResolve (node:internal/modules/esm/resolve:992:10)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:936:12)
    at defaultResolve (node:internal/modules/esm/resolve:1178:79)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

This appears to be because something in the <GLTF /> component from our 3D component library threlte is importing from THREE under the hood but Svelte isn't able to pick up on that for bundling the SSR code. I'm trying to explicitly import it in the hopes that works.

@vercel
Copy link

vercel bot commented Oct 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
text-to-cad-ui ✅ Ready (Inspect) Visit Preview Oct 19, 2023 7:42am

@franknoirot
Copy link
Collaborator Author

That did not work.

@franknoirot franknoirot merged commit a666f6c into main Oct 19, 2023
2 checks passed
@franknoirot franknoirot deleted the fix-deps branch October 19, 2023 07:42
@franknoirot franknoirot changed the title Try import bundling THREEjs explicitly Fix threlte bundling configuration Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant