Import errors with the package #react-three/drei - reactjs

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.

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

Related

I am using react-dnd in react version 16.0.1, I cant upgrade the react version but react-dnd is not working in this version

I am getting this error
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'C:\Micromerger\realStockExchange\node_modules\react-dnd\dist\core'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' 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.

I m getting this error, i run my react native using expo

While trying to resolve module idb from file `
C:\Users\chouk\OneDrive\Bureau\my-app\node_modules\#firebase\app\dist\esm\index.esm2017.js
, the package C:\Users\chouk\OneDrive\Bureau\my-app\node_modules\idb\package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (C:\Users\chouk\OneDrive\Bureau\my-app\node_modules\idb\build\index.cjs. Indeed, none of these files exist:
C:\Users\chouk\OneDrive\Bureau\my-app\node_modules\idb\build\index.cjs(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
C:\Users\chouk\OneDrive\Bureau\my-app\node_modules\idb\build\index.cjs\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
I hit this exact issue and "fixed" it by downgrading the firebase dependency to 9.7.0 (it was previously 9.8.1)
You can do that by editing the firebase entry in the dependencies section of package.json to be "9.7.0"

Module not found: Can't resolve './reducers/index'

Module not found: Can't resolve './reducers/index' in'C:\Users\Dibba\Desktop\rdx\src'
This error occurred during the build time and cannot be dismissed.
node version is
v9.11.2
npm version is
6.9.1-next.0
structure:
error message :
code:
Your app is not able to find your root reducer since the file name on disk doesn't match the file name in the code. There appears to be a trailing space in the filename of ./reducers/index.js, from what I can see in your first screenshot. Remove the space and your app should be able to find the file without problem.
You have to remove the /index from the directory './reducers/index' and set it to './reducers'. It should work.
If the above does not work for you, check the steps below.
Make sure the reducers folder is created in the 'src' directory and create a file named index.js in the reducers folder.

deploying gatsby (v2) to netlify errors

I'm having some issues deploying to netlify. These are the errors I receive:
Error: ./src/pages/index.js
12:55:30 PM: Module not found: Error: Can't resolve '../components/Featured' in '/opt/build /repo/src/pages'
12:55:30 PM: resolve '../components/Featured' in '/opt/build/repo/src/pages'
12:55:30 PM: using description file: /opt/build/repo/package.json (relative path: ./src/p ages)
12:55:30 PM: Field 'browser' doesn't contain a valid alias configuration
For some reason it can't find the components. Building locally works fine.
I used gatsby-starter w styled-components.
things I tried:
I had some local building errors regarding the window undefined. I fixed these by conditionally including them as the manual proposes.
After applying this, I started receiving console logs from ‘workbox’.
(btw this is my first time trying to deploy to netlify)
also the error Field 'browser' doesn't contain a valid alias configuration keeps repeating in the logs
here's a link to the full log I get from netlify
The errors are due to webpack not being able to resolve your relative paths. Make sure to use the correct case.
import Hero from '../components/hero'
import Introduce from '../components/introduce'
import HelpMeHelpYou from '../components/helpmehelpyou'
import Featured from '../components/featured'
import Testimonials from '../components/testimonials'
import Projects from '../components/projects'
import Gallery from '../components/gallery'
import Outroduce from '../components/outroduce'
Run below command and then push the code to Github repository.
git config core.ignorecase false

Module not found: Can't resolve './AppRoutes'

I'm following this react workshop:
https://github.com/spietrek/workshop.reactjs.1/blob/master/presentation/Introduction%20to%20ReactJS%20Workshop.pdf
I'm following all the code but I'm getting an error:
Module not found: Can't resolve './AppRoutes'...
Here's the editable project url:
https://stackblitz.com/edit/react-project
I'm at pg 17/27
You have put a space before the name of the file AppRoutes.js like <space>AppRoutes.js.
You have to remove the space to fix that error.
After fixing this also in you project there are some errors due to Fragment. I fixed that by updating react and react-dom packages to version 16.2.0.
This is a working fork of you project.
If AppRoutes is a .jsx file you have to load it with the .jsx file extension. Like ./AppRoutes.jsx

Resources