Skip to content
Source
Sign inSign up
TanStack/cli

Error when creating a tanstack CLI project with neon db #410

Send to my agent
Closedryan-ludwig(GitHub profile, opens in a new tab) opened this issue 1 comment

Which project does this relate to?

Create Tanstack App

Describe the bug

When using tanstack CLI to scaffold a project that includes neon db, after the cli runs, running npm run dev fails.

Your Example Website or App

N/A

Steps to Reproduce the Bug or Issue

  1. From a blank folder, create a new tanstack cli app: npx @tanstack/cli@latest create neon-demo --tailwind --add-ons start,neon
  2. Run cd neon-demo, then npm run dev
  3. See the following error:
$  neon-demo git:(main) ✗ npm run dev

> dev
> vite dev --port 3000

failed to load config from /neon-start/neon-demo/vite.config.ts
error when starting dev server:
file:///neon-start/neon-demo/node_modules/.vite-temp/vite.config.ts.timestamp-1773609677178-abd252f37585a.mjs:10
import { postgresPlugin } from "file:///neon-start/neon-demo/node_modules/@neondatabase/vite-plugin-postgres/dist/index.js";
         ^^^^^^^^^^^^^^
SyntaxError: The requested module 'file:///neon-start/neon-demo/node_modules/@neondatabase/vite-plugin-postgres/dist/index.js' does not provide an export named 'postgresPlugin'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:180:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:263:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:578:26)
    at async loadConfigFromBundledFile (file:///neon-start/neon-demo/node_modules/vite/dist/node/chunks/config.js:35909:12)
    at async bundleAndLoadConfigFile (file:///neon-start/neon-demo/node_modules/vite/dist/node/chunks/config.js:35797:17)
    at async loadConfigFromFile (file:///neon-start/neon-demo/node_modules/vite/dist/node/chunks/config.js:35764:42)
    at async resolveConfig (file:///neon-start/neon-demo/node_modules/vite/dist/node/chunks/config.js:35413:22)
    at async _createServer (file:///neon-start/neon-demo/node_modules/vite/dist/node/chunks/config.js:25362:67)
    at async CAC.<anonymous> (file:///neon-start/neon-demo/node_modules/vite/dist/node/cli.js:572:18)
$  neon-demo git:(main) ✗

Expected behavior

That npm run dev would succeed and the neon db package would be imported.

Screenshots or Videos

No response

Platform

  • OS: MacOS

Additional context

No response

  1. This was addressed in commit ddfaaaa (fix(neon): migrate scaffold plugin to vite-plugin-neon-new) on March 19. The deprecated @neondatabase/vite-plugin-postgres (which no longer exports postgresPlugin) was replaced with vite-plugin-neon-new, and the import is now import { postgres } from 'vite-plugin-neon-new'. The fix is on main and just waiting on a release.


    Generated by Claude Code

Sign in to join this conversation.