1

folder structure

As it shows in the picture, I have two projects that share some vue components.
I import ImageBlock.vue in my Card.vue component, it works fine. But when I write test cases for Card component, I got the error

> Cannot find module 'vue' from '../sharedComponents/ImageBlock.vue'

I searched, couldn't find any answers. How can I solve this?

1 Answer 1

0

I think the path from your test directory is wrong. If your test is in project2/test,

you should try importing from ../../sharedComponents/ImageBlock.vue

Sign up to request clarification or add additional context in comments.

1 Comment

The path is not the problem. That component is imported correctly, and I don't need to import it in the test file. It's something else.

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.