browserbase / stagehand

An AI web browsing framework focused on simplicity and extensibility.
https://www.browserbase.com
MIT License
1.18k stars 46 forks source link

Build DOM scripts so that importing doesn't fail in Next.js #180

Closed jeremypress closed 2 days ago

jeremypress commented 1 week ago

Reported here: https://stagehand-dev.slack.com/archives/C07UCP76U8G/p1731825603169509

Our DOM scripts are not found when using Next.js due to static imports, these can be built correctly so they are used like other source files in a package.

 ⨯ unhandledRejection: Error: ENOENT: no such file or directory, open '<some>/<path>/app/.next/server/dist/dom/build/xpathUtils.js'
    at Generator.next (<anonymous>) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '<some>/<path>/app/.next/server/dist/dom/build/xpathUtils.js'
}