Home > Software design >  Unable to resolve module [external url] within the project or in these directories: node_modules
Unable to resolve module [external url] within the project or in these directories: node_modules

Time:10-16

Im doing a project in react native

I have an object of exercises that include images and videos, everything is fine when the object was created, but when I imported into another file I get this error

undefined Unable to resolve module enter image description here

This is the file of the exercises

enter image description here

And this is the file where I import it, when it happens, the apps automatically crashes with the error message

enter image description here

It would be awesome if someone wcould help me!! thanks in advance

CodePudding user response:

I don't think you need require() for URL, you only need it if the image/video/file is on your local machine.

so what you need is:

export const exercises = {
  bodyWeightSquats: {
    ...,
    video: " https://assets.soysuper.fit/cutted mvp mp4s/bodyweight_squats.mp4 ",
    image: "https://yourlinktotheimage.com/something.png",
  }
  • Related