framesjs/frames.js

Build Failure Due to Import Misuse in `framesjs-starter`

Closed this issue · 3 comments

The framesjs-starter boilerplate fails to build in the most recent version. This is caused by a problem in the framesjs package when running next build. There seems to be a misuse when protobufjs/minimal is imported without a [.js](https://nodejs.org/api/esm.html#mandatory-file-extensions) extension. This seems to be a similar issue vercel/next.js#31974.

Temporary workarounds:

Error

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/frames/node_modules/protobufjs/minimal' imported from /frames/node_modules/frames.js/dist/chunk-5PU7OFBJ.js

Did you mean to import protobufjs/minimal.js?
    at new NodeError (node:internal/errors:405:5)
    at finalizeResolution (node:internal/modules/esm/resolve:324:11)
    at moduleResolve (node:internal/modules/esm/resolve:943:10)
    at defaultResolve (node:internal/modules/esm/resolve:1129:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36) {
  code: 'ERR_MODULE_NOT_FOUND'```

Thanks for your thorough evaluation of the issue. Looks like it's cause by the pages-router example which was recently added. If you're not using pages router, removing the pages directory should help it build in the meantime.

We're looking into a fix

Closed by #292

@cashd Please update to the latest frames.js version and follow the guide here for instructions on how to integrate with pages router. Thanks!