0

When I try to import css files from components, an error occurs.

Failed to compile.

./src/components/HeaderTemplate.js
Module not found: Can't resolve './styles/HeaderTemplate.css' in '/workspace/test/myapp/src/components'

I think there's an error in the path, but I don't know how to change it, so I'm asking.

enter image description here

1 Answer 1

2

You should go up one level when importing:

import styles from '../styles/HeaderTemplate.css'
Sign up to request clarification or add additional context in comments.

Comments

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.