frames.js: Import error

Getting this error:

Cannot find module 'frames.js/next/server' or its corresponding type declarations.ts(2307)

When doing:

export { POST } from "frames.js/next/server";

Next.js project. Anything I need to add to fix it?

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

@davidfurlong if this can help, finally found what was wrong on my end trying to run the starter example - since this is a monorepo, yarn needs to be ran first at the root of the repo. I noticed that running yarn first in the framesjs-starter would install frames.js without building it.

Since the build is done on prepublish hook, that makes sense, in other words, the example script won’t run if cloning the repo. I’d assume this is a common issue, since most wouldn’t think about moving the folder somewhere else and git initing it as its own repo.

https://github.com/framesjs/frames.js/pull/76

Here you go:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "sourceMap": true,
    "outDir": "dist",
    "baseUrl": ".",
    "paths": {
      "@utils/*": ["utils/*"],
      "@components/*": ["components/*"],
      "@app/*": ["app/*"],
      "@pages/*": ["pages/*"],
      "@api/*": ["pages/api/*"],
      "@hooks/*": ["hooks/*"],
      "@layouts/*": ["layouts/*"],
      "@providers/*": ["providers/*"],
      "@images/*": ["images/*"],
      "@validations/*": ["validations/*"],
      "@emails/*": ["emails/*"]
    },
    "plugins": [
      {
        "name": "next"
      }
    ]
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules", "cypress"]
}