2

I have this line in one of my tsx file:

import styles from "../../styles/buyTicket.module.css";

got this error:

ERROR in /Applications/MAMP/htdocs/wp-content/plugins/tikex/tikexModule/components/BuyTicket/PricingOptionInvoiceItemsFormFieldsCheckboxes.tsx
./tikexModule/components/BuyTicket/PricingOptionInvoiceItemsFormFieldsCheckboxes.tsx 7:19-54
[tsl] ERROR in /Applications/MAMP/htdocs/wp-content/plugins/tikex/tikexModule/components/BuyTicket/PricingOptionInvoiceItemsFormFieldsCheckboxes.tsx(7,20)
      TS2307: Cannot find module '../../styles/buyTicket.module.css' or its corresponding type declarations.

If I remove styles then I got this error no more, but then it will work not as a CSS module, and naming collosion will happen. What would you suggest?

2
  • have you tried just importing it like so: import "../../styles/buyTicket.module.css";? Commented Jan 13, 2022 at 7:22
  • Yes, it works then, but then it will work not as a CSS module, and naming collosion will happen. Commented Jan 13, 2022 at 7:26

1 Answer 1

0

As far as i can understand, you may have a look here:
Can't import CSS/SCSS modules. TypeScript says "Cannot Find Module"

and here:
React, Typescript - Cannot find module ... or its corresponding type declarations

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.