WaspW
Waspโ€ข12mo ago
Xuban

I need help with adding a new route

Dear wasp community, I'm starting my new SaaS and I want to add new pages. But when I run into this error:
~/documents/yawningstudio/app$ wasp db migrate-dev

๐Ÿ --- Compiling wasp project... --------------------------------------------------
โœ… --- Successfully completed npm install. ----------------------------------------
๐Ÿ --- Setting up database... -----------------------------------------------------
โœ… --- Database successfully set up. ----------------------------------------------
๐Ÿ --- Building SDK... ------------------------------------------------------------
[  Wasp  ] ext-src/client/components/NavBar/contentSections.ts(8,32): error TS2339: Property 'StudioRoute' does not exist on type '{ readonly LandingPageRoute: { readonly to: "/"; readonly build: (options?: OptionalRouteOptions) => string; }; readonly LoginRoute: { readonly to: "/login"; readonly build: (options?: OptionalRouteOptions) => string; }; ... 19 more ...; readonly AdminMessagesRoute: { ...; }; }'.

โŒ --- [Error] Your wasp project failed to compile: -------------------------------
- SDK build failed with exit code: 2

โŒ --- [Error] Compilation of wasp project failed: --------------------------------
1 errors found



My understanding is that it's not detected the new route I added.

This is what contentSections.ts looks like (I added line 8 - Studio)
import type { NavigationItem } from '../NavBar/NavBar';
import { routes } from 'wasp/client/router';
import { BlogUrl, DocsUrl } from '../../../shared/common';

export const appNavigationItems: NavigationItem[] = [
  { name: 'AI Scheduler (Demo App)', to: routes.DemoAppRoute.to },
  { name: 'File Upload (AWS S3)', to: routes.FileUploadRoute.to },
  { name: 'Studio', to: routes.StudioRoute.to },
  { name: 'Pricing', to: routes.PricingPageRoute.to },
  { name: 'Documentation', to: DocsUrl },
  { name: 'Blog', to: BlogUrl },
];



And I also made sure to add Studio in index.d.ts and index.js
Was this page helpful?