raidendotai/openv0

Error: Cannot redefine property: File

MarkLyck opened this issue · 1 comments

Getting the following error when following the install instructions and running npm run dev in the webapp folder.

failed to load config from /Users/marklyck/web/openv0/webapp/vite.config.ts
error when starting dev server:
TypeError: Cannot redefine property: File
    at Function.defineProperty (<anonymous>)
    at Object.<anonymous> (/Users/marklyck/web/openv0/webapp/node_modules/@babel/core/lib/index.js:7:8)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/Users/marklyck/web/openv0/webapp/node_modules/@babel/core/lib/config/helpers/config-api.js:16:14)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)

Server seems to start fine.

I tried clearing node_modules and reinstalling, but still the same issue. Tried with bun instead npm but also same issue.

Here's the vite.config.ts file it's complaining about:

import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },
  },
});

in the setup options I chose:

  • react
  • ShadCN
  • Lucide
  • I pasted my OpenAI API key
  • (Y) to the last recommended option.

installation had no issues

Turned out to be an issue with node version 20.6.0, I upgraded to 20.8.0 and the problem went away.