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 react-hexgrid@2.0.1 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).
Steps to reproduce: 1. create-t3-app 2. npm i react-hexgrid 3. put
import { Hexagon } from 'react-hexgrid';
import { Hexagon } from 'react-hexgrid';
and
const hexes = GridGenerator.hexagon(6);
const hexes = GridGenerator.hexagon(6);
in index.tsx
Error message:
Server ErrorSyntaxError: Cannot use import statement outside a moduleThis error happened while generating the page. Any console logs will be displayed in the terminal window.Call Stack<unknown>file:///home/cyremur/t3hextest/node_modules/react-hexgrid/lib/index.js (1)
Server ErrorSyntaxError: Cannot use import statement outside a moduleThis error happened while generating the page. Any console logs will be displayed in the terminal window.Call Stack<unknown>file:///home/cyremur/t3hextest/node_modules/react-hexgrid/lib/index.js (1)