Repository: next.js
Issue: Nextjs Gsap ScrollTrigger snapping not working
Labels: bug,TypeScript,Script (next/script)

### Link to the code that reproduces this issue

[CodeSanndbox](https://codesandbox.io/p/devbox/laughing-mclean-kpn8y8?workspaceId=57c17864-14fc-4e90-b966-a5ccb5e010e2&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clsknato400072v6o0o6unszm%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clsknato100022v6ofgnzw85q%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clsknato200042v6oydacync1%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clsknato300062v6opvizae0h%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clsknato100022v6ofgnzw85q%2522%253A%257B%2522id%2522%253A%2522clsknato100022v6ofgnzw85q%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522clsknato300062v6opvizae0h%2522%253A%257B%2522id%2522%253A%2522clsknato300062v6opvizae0h%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A3000%252C%2522id%2522%253A%2522clskns6wd00fd2v6oe5v8v4eg%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253)

### To Reproduce

1. Open the provided [Codepen](https://codepen.io/Ryan-Goss/pen/OJqopEQ) example without NextJS.
2. Open the provided [CodeSandbox](https://codesandbox.io/p/devbox/laughing-mclean-kpn8y8?workspaceId=57c17864-14fc-4e90-b966-a5ccb5e010e2&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clsknato400072v6o0o6unszm%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clsknato100022v6ofgnzw85q%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clsknato200042v6oydacync1%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clsknato300062v6opvizae0h%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clsknato100022v6ofgnzw85q%2522%253A%257B%2522id%2522%253A%2522clsknato100022v6ofgnzw85q%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522clsknato300062v6opvizae0h%2522%253A%257B%2522id%2522%253A%2522clsknato300062v6opvizae0h%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A3000%252C%2522id%2522%253A%2522clskns6wd00fd2v6oe5v8v4eg%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253) Next.js example.
3. Observe that GSAP ScrollTrigger snapping functionality work perfectly fine in CodePen example
4. Observe that GSAP ScrollTrigger snapping functionality doesn't work in CodeSandbox example
5. Compare with the provided CodePen bare HTML/CSS/JS example where the snapping functionality works correctly.

### Current vs. Expected behavior

1. Open the provided [Codepen](https://codepen.io/Ryan-Goss/pen/OJqopEQ) example without NextJS.
2. Open the provided [CodeSandbox](https://codesandbox.io/p/devbox/laughing-mclean-kpn8y8?workspaceId=57c17864-14fc-4e90-b966-a5ccb5e010e2&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clsknato400072v6o0o6unszm%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clsknato100022v6ofgnzw85q%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clsknato200042v6oydacync1%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clsknato300062v6opvizae0h%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clsknato100022v6ofgnzw85q%2522%253A%257B%2522id%2522%253A%2522clsknato100022v6ofgnzw85q%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522clsknato300062v6opvizae0h%2522%253A%257B%2522id%2522%253A%2522clsknato300062v6opvizae0h%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A3000%252C%2522id%2522%253A%2522clskns6wd00fd2v6oe5v8v4eg%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253) Next.js example.
3. Observe that GSAP ScrollTrigger snapping functionality work perfectly fine in CodePen example
4. Observe that GSAP ScrollTrigger snapping functionality doesn't work in CodeSandbox example
5. Compare with the provided CodePen bare HTML/CSS/JS example where the snapping functionality works correctly.

### Provide environment information

```bash
Packages:
  Next.js version: ^14.1.0
  GSAP version: ^3.12.5
  GSAP react (@gsap/react): ^2.1.0
```


### Which area(s) are affected? (Select all that apply)

Not sure, Script optimization (next/script), TypeScript (plugin, built-in types)

### Which stage(s) are affected? (Select all that apply)

next dev (local)

### Additional context

_No response_