Skip to content

start: The requested module '@tanstack/router-generator' does not provide an export named 'CONSTANTS' #4380

Closed
@erik-kroon

Description

@erik-kroon

Which project does this relate to?

Start

Describe the bug

i was updating a different library, ran the following command:
$ rm -rf bun.lock && rm -rf node_modules && rm -rf apps/*/node_modules && bun i
and afterwards my dev server won't start. at first it was something about @tanstack/react-start/config not exporting defineConfig, switched to @tanstack/react-start-config and now this err

$ vinxi dev --port=3001
vinxi v0.5.7
file:///Users/erik/autoseo/node_modules/@tanstack/react-start-config/dist/esm/vinxi-file-router.js:2
import { CONSTANTS as GENERATOR_CONSTANTS, startAPIRouteSegmentsFromTSRFilePath, } from '@tanstack/router-generator';
^^^^^^^^^
SyntaxError: The requested module '@tanstack/router-generator' does not provide an export named 'CONSTANTS'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async loadFile (file:///Users/erik/autoseo/node_modules/vinxi/lib/load-app.js:83:25)
at async loadApp (file:///Users/erik/autoseo/node_modules/vinxi/lib/load-app.js:137:19)
at async Object.run (file:///Users/erik/autoseo/node_modules/vinxi/bin/cli.mjs:76:17)
at async runCommand (file:///Users/erik/autoseo/node_modules/citty/dist/index.mjs:316:16)
at async runCommand (file:///Users/erik/autoseo/node_modules/citty/dist/index.mjs:307:11)
at async runMain (file:///Users/erik/autoseo/node_modules/citty/dist/index.mjs:445:7)

ERROR Cannot read properties of undefined (reading 'config') 12:02:19 PM

at Object.run (/Users/erik/autoseo/node_modules/vinxi/bin/cli.mjs:79:9)
at async runCommand (/Users/erik/autoseo/node_modules/citty/dist/index.mjs:316:16)
at async runCommand (/Users/erik/autoseo/node_modules/citty/dist/index.mjs:307:11)
at async runMain (/Users/erik/autoseo/node_modules/citty/dist/index.mjs:445:7)

ERROR Cannot read properties of undefined (reading 'config') 12:02:19 PM

error: script "dev" exited with code 1

Your Example Website or App

do not know how to reproduce unfortunately

Steps to Reproduce the Bug or Issue

i am unsure

Expected behavior

it should start

Screenshots or Videos

No response

Platform

"@tanstack/react-form": "^1.11.1",
"@tanstack/react-query": "^5.71.10",
"@tanstack/react-router": "^1.121.0",
"@tanstack/react-router-with-query": "^1.121.0",
"@tanstack/react-start": "^1.121.0",
"@tanstack/react-start-config": "^1.120.20",
"@tanstack/react-table": "8.21.2",
"@tanstack/router-plugin": "^1.121.0",

OS: macOS 14.6.1
Memory: 16 GiB
Architecture: aarch64

Additional context

app.config.ts:
import { defineConfig } from "@tanstack/react-start-config";
import viteTsConfigPaths from "vite-tsconfig-paths";
import tailwindcss from "@tailwindcss/vite";
import { cloudflare } from "unenv";
import nitroCloudflareBindings from "nitro-cloudflare-dev";

export default defineConfig({
tsr: {
appDirectory: "src",
},
vite: {
plugins: [
viteTsConfigPaths({
projects: ["./tsconfig.json"],
}),
tailwindcss(),
],
},

react: {
exclude: ["pg-cloudflare"],
},
server: {
preset: "cloudflare-module",
unenv: cloudflare,
modules: [nitroCloudflareBindings],
},
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions