Jump to content
Search Community

error syntaxError - import { getGlobalMatrix, Matrix2D } from "./utils/matrix.js";

raana test
Moderator Tag

Recommended Posts

I have a problem that I get this error when I want to output my project.

I do not know if this problem is related to forums or not.

 

"next": "^11.0.0"

"react": "^17.0.2"

 

1286248352_Screenshotfrom2021-11-1113-21-53.thumb.png.94faa36ed9c91b1b4576fa8b017ab0b2.png

import { getGlobalMatrix, Matrix2D } from "./utils/matrix.js";
 

Link to comment
Share on other sites

That error might be coming from server side rendering as client side scripts won't work. Try checking for a window object first like this...

 

if (typeof window !== "undefined") {
  gsap.registerPlugin(Draggable, InertiaPlugin);
} 

 

Or register it inside an effect as those won't run server side.

useEffect(() => {
  gsap.registerPlugin(Draggable, InertiaPlugin);
}, []);

 

  • Thanks 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...