WildThing
WildThing

Reputation: 1275

Import errors with the package @react-three/drei

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.

Upvotes: 2

Views: 776

Answers (1)

Codezilla
Codezilla

Reputation: 11

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

Upvotes: 1

Related Questions