2

I get the same error no matter what I import from the drei package, I am sure I have installed all the necessary packages and the latest versions, but I have this odd error.

Compiled with problems:X

ERROR in ./node_modules/@react-three/drei/core/Trail.js 104:38-54

export 'MeshLineGeometry' (imported as 'MeshLineGeometry') was not found in 'meshline' (module has no exports)


ERROR in ./node_modules/@react-three/drei/core/Trail.js 107:18-34

export 'MeshLineMaterial' (imported as 'MeshLineMaterial') was not found in 'meshline' (module has no exports)


ERROR in ./node_modules/meshline/dist/index.js 1:0-35

Module not found: Error: Can't resolve './MeshLineGeometry' in 'C:\Users\anura\Desktop\mysite\node_modules\meshline\dist'
Did you mean 'MeshLineGeometry.js'?
BREAKING CHANGE: The request './MeshLineGeometry' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
2
  • Try downgrading to 9.40.0. I have the same issue with version 9.46.4. Commented Dec 13, 2022 at 11:11
  • @TheKalashnikov I'm at version 9.36.0 and have the problem too Commented Dec 13, 2022 at 15:56

1 Answer 1

1

Downgrading not working solved it temporarily as follows.

  • Copied the index.js from node_modules/meshline/dist to lib/meshline in the root folder
  • Fixed by adding .js extensions to each line
  • Updated build steps as in the screenshots

Fixed index.js in lib/meshline

Build steps

Sign up to request clarification or add additional context in comments.

2 Comments

Still doesn't work for me
You are right my mistake looks like I fixed it manually. Updating my answer with my solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.