Skip to content

Conversation

@StvyaSharma
Copy link

@StvyaSharma StvyaSharma commented Jan 22, 2026

When using the Store add-on with code-router mode in React applications, the build of output template would fail with the following error:

[plugin:vite:import-analysis] Failed to resolve import "./routes/demo.store.tsx" from "src/main.tsx". Does the file exist?

Root Cause

There was a mismatch between theRoute path defined in info.json: "src/routes/demo.store.tsx" and the actual file location: frameworks/react-cra/add-ons/store/assets/src/routes/demo/store.tsx.ejs

This caused the code-router template to generate an incorrect import path in main.tsx.ejs:

import StoreDemo from "./routes/demo.store.tsx";

But the actual file was being generated at ./routes/demo/store.tsx (in a subdirectory).

The issue only affected code-router mode because:

  • Code Router: Uses relativePath(route.path) to generate explicit imports
  • File Router: Relies on automatic route discovery via routeTree.gen, so the path mismatch doesn't matter

Solution

Rename the store template file to match the path defined in info.json:

frameworks/react-cra/add-ons/store/assets/src/routes/demo/store.tsx.ejs -> frameworks/react-cra/add-ons/store/assets/src/routes/demo.store.tsx.ejs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant