React import of functions and components fails to import

I keep getting a “Failed to compile” message for any imports that reference a path to a file. The ‘react’ and ‘react-bootstrap’ imported just fine. It is specifically when I am importing components from files:

import React, { useRef } from ‘react’
import { Form, Button, Card } from “react-bootstrap”
import useAuth from “./context/AuthContext” //not importing

I have been searching online and I come across suggestions about webpacks. May someone explain a little more about the format and process of importing? Am I not formatting this correctly?

Thanks!

are you exporting useAuth from AuthContext? If you do, is that a default import?

Is the relative path correct from the file you try to import to?

Share the project and I am happy to help.

1 Like

I think it was because my .env wasn’t setup with my keys. That seemed to resolve issue. Now, I am getting a missing start script message. It’s just a general react with firebase sign up/login page and bootstrap styling. Nothing fancy at the moment. I am thinking my react is not properly installed, because the start script looks fine.

Thank you for answering my question.

1 Like

Did you use CRA to set up the project?

1 Like

I did. Is that the cause of the start script error?

I don’t think so. I asked because you mentioned webpack and CRA comes with webpack. It could be the version of node you are using. Try reading through the following.
https://github.com/facebook/create-react-app/issues/9594.

1 Like

If you need any help, drop me a message and we can do share screen via zoom or hangouts if you like.

1 Like

Thanks, Nibble. I’ll give this FB clone a try and see if that helps with my foundational understanding of react. Much appreciated.

I sent you a message. Thanks for the help. Building out the react app, so fun complexity is in my future for this app.