Next.js Discord

Discord Forum

(Vercel) TypeError: e.saved.toReversed is not a function

Answered
piscopancer posted this in #help-forum
Open in Discord
my local build is fine, but vercel deply errs.
## tsconfig
{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next",
      },
    ],
    "paths": {
      "@/*": ["./src/*"],
    },
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"],
}

## nextjs config
const withMDX = require('@next/mdx')()

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    typedRoutes: true,
  },
  logging: { fetches: { fullUrl: true } },
  reactStrictMode: false,
  pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
}

module.exports = withMDX(nextConfig)

## package
{
  // ...
  "dependencies": {
    "@mdx-js/loader": "^3.0.0",
    "@mdx-js/react": "^3.0.0",
    "@next/mdx": "^14.1.0",
    "@radix-ui/react-dropdown-menu": "^2.0.6",
    "@radix-ui/react-toast": "^1.1.5",
    "@radix-ui/react-tooltip": "^1.0.7",
    "@types/jsdom": "^21.1.6",
    "@types/mdx": "^2.0.10",
    "date-fns": "^3.3.1",
    "framer-motion": "^10.17.12",
    "html-react-parser": "^5.0.11",
    "jsdom": "^23.2.0",
    "next": "^14.1.0",
    "react": "^18",
    "react-dom": "^18",
    "react-icons": "^5.0.1",
    "sass": "^1.69.7",
    "valtio": "^1.13.0",
    "zod": "^3.22.4"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10.0.1",
    "eslint": "^8",
    "eslint-config-next": "14.0.4",
    "postcss": "^8",
    "prettier": "^3.2.4",
    "prettier-plugin-tailwindcss": "^0.5.11",
    "tailwindcss": "^3.3.0",
    "typescript": "^5"
  }
}
Answered by joulev
Should be in project settings, scroll down a bit
View full answer

7 Replies

can it err because array is readonly?
which still makes little sense because my project successfully builds locally
@piscopancer my local build is fine, but vercel deply errs. ## tsconfig json { "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", "incremental": true, "plugins": [ { "name": "next", }, ], "paths": { "@/*": ["./src/*"], }, }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"], } ## nextjs config js const withMDX = require('@next/mdx')() /** @type {import('next').NextConfig} */ const nextConfig = { experimental: { typedRoutes: true, }, logging: { fetches: { fullUrl: true } }, reactStrictMode: false, pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'], } module.exports = withMDX(nextConfig) ## package json { // ... "dependencies": { "@mdx-js/loader": "^3.0.0", "@mdx-js/react": "^3.0.0", "@next/mdx": "^14.1.0", "@radix-ui/react-dropdown-menu": "^2.0.6", "@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-tooltip": "^1.0.7", "@types/jsdom": "^21.1.6", "@types/mdx": "^2.0.10", "date-fns": "^3.3.1", "framer-motion": "^10.17.12", "html-react-parser": "^5.0.11", "jsdom": "^23.2.0", "next": "^14.1.0", "react": "^18", "react-dom": "^18", "react-icons": "^5.0.1", "sass": "^1.69.7", "valtio": "^1.13.0", "zod": "^3.22.4" }, "devDependencies": { "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", "eslint": "^8", "eslint-config-next": "14.0.4", "postcss": "^8", "prettier": "^3.2.4", "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.3.0", "typescript": "^5" } }
toReversed is only available from Node 20. Either update vercel settings to use node 20 or use an alternative
oh, ok, i knew there was smth up with vercel, hope i will find where i can change the version
Should be in project settings, scroll down a bit
Answer
@joulev Should be in project settings, scroll down a bit
much love, it worked, did not know you can actually set a node version
🍑💖