Shopify/shopify-frontend-template-react

Uncaught ReferenceError: React is not defined

Crunchyman-ralph opened this issue · 0 comments

Issue summary

Write a short description of the issue here ↓

Get this error:

Uncaught ReferenceError: React is not defined

When trying to import a React Component into index and trying to import that index inside a page

.
├── ...
├── components                 
│   ├── ProductsCard         
│           ├── index.tsx
│           └── ProductsCard.tsx
└── ...

Expected behavior

What do you think should happen?

Should be able to compile correctly

Actual behavior

What actually happens?

Uncaught ReferenceError: React is not defined

Steps to reproduce the problem

  1. Create a Directory inside components ProductsCard for example
  2. create an index.tsx file with import * from './ProductsCard'
  3. import {ProductsCard} from 'frontend/components/ProductsCart' inside pages/index.tsx
  4. Will get an error Uncaught ReferenceError: React is not defined

Reduced test case

The best way to get your bug fixed is to provide a reduced test case.

Specifications

  • Browser: Chrome
  • Device: Computer
  • Operating System: Windows 10