ct3a + react-hexgrid npm package = "Cannot use import statement outside a module"
So I'm a bit confused about this and it's somewhat hard to google cause content mills spam the search with unrelated(?) beginner tutorials...
Basically, when I try to import from the [email protected] npm package from a ct3a app, I get the error on page load.
Any hints for understanding this problem are appreciated.
FWIW, I tried the package with a create-react-app and at least it spat out a webpage (with a couple warnings/errors).
Here's a github minimal example to run: https://github.com/cyremur/t3-hexgrid-minmal-error
Steps to reproduce:
1. create-t3-app
2. npm i react-hexgrid
3. put
import { Hexagon } from 'react-hexgrid';
and const hexes = GridGenerator.hexagon(6);
in index.tsx
Error message:
GitHub
GitHub - cyremur/t3-hexgrid-minmal-error
Contribute to cyremur/t3-hexgrid-minmal-error development by creating an account on GitHub.
1 Reply
Solution: