Skip to content
New issue

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

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

Already on GitHub? # to your account

Error trying to render a GraphCanvas component in nextjs client component #278

Open
maor-alma opened this issue Sep 21, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@maor-alma
Copy link

maor-alma commented Sep 21, 2024

Describe the bug

Using NextJS 14.
It works well on StoryBook.
Getting a bug when trying to render the graph inside a nextjs page.

 ⨯ ./node_modules/reagraph/node_modules/three-mesh-bvh/src/utils/ExtensionUtilities.js
Attempted import error: 'BatchedMesh' is not exported from 'three' (imported as 'THREE').

Import trace for requested module:
./node_modules/reagraph/node_modules/three-mesh-bvh/src/utils/ExtensionUtilities.js
./node_modules/reagraph/node_modules/three-mesh-bvh/src/index.js
./node_modules/reagraph/node_modules/glodrei/core/useBVH.js
./node_modules/reagraph/node_modules/glodrei/index.js
./node_modules/reagraph/dist/index.js

Steps to Reproduce the Bug or Issue

  • Intall nextjs 14 + reagraph
  • Create a client component with a <GraphCanvas />
  • Render the component inside a nextjs page
  • Open this page in the browser

Expected behavior

I expected the render to work as it is a client component

Screenshots or Videos

image

Platform

  • Browser: Chrome Version 129.0.6668.59 (Official Build) (arm64)
  • NodeJS version: v20.15.0
  • NextJS version: v14.2.13
  • Reagraph Version: v4.19.3
@amcdnl amcdnl added the bug Something isn't working label Sep 23, 2024
@dmurvihill
Copy link

dmurvihill commented Oct 1, 2024

Just hit this last week. See #277 and three-mesh-bvh 711. Pin three-mesh-bvh to 0.8 for now.

@samsmusa
Copy link

samsmusa commented Dec 3, 2024

I'm also facing the same issue :(

@samsmusa
Copy link

samsmusa commented Dec 3, 2024

I solved it by adding these to the package.json
"resolutions": {
"three": "^0.159.0",
"three-mesh-bvh": "^0.8.0"
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants