kylejlin / react-isometric-projection

A React component for rendering isometric projections inside SVG.
https://kylejlin.github.io/react-isometric-projection-demo
MIT License
5 stars 1 forks source link

pragma cannot be set when runtime is automatic #1

Closed stahlmanDesign closed 6 months ago

stahlmanDesign commented 6 months ago

In trying to get your demo to work, in NextJS (I haven't tested Regular React) there is an error related to this part of the code:

// The comment below tells the transpiler to use jsxToObj()
//   instead of React.createElement() when transpiling JSX to function calls

/** @jsx jsxToObj **/

pragma cannot be set when runtime is automatic`

If I remove the commented lines there is a different error:

TypeError: vbd is undefined

kylejlin commented 6 months ago

pragma cannot be set when runtime is automatic

I'm not familiar with NextJS, but I'm guessing this error message means the compiler/transpiler won't let you use the @jsx directive, probably due to the current NextJS configuration. In that case, you'll have to either give up on using react-isometric-projection's JSX syntax (you can usual the standard Polygon({...}) syntax instead) or you'll have to change your build configuration to allow the use of the @jsx directive.

kylejlin commented 6 months ago

Closing, as this issue does not seem to be a problem with react-isometric-projection, but rather with the NextJS config. If I'm wrong, feel free to reopen.