Migrating error - Reading CollectionScheme

When migrating with

yarn nocobase upgrade

I get an error and migration stop

* Environment

  • NocoBase version:
    1.5
  • Database type and version:
    Postgres 16
  • OS:
    ubuntu server 24.04.02
  • Deployment Methods:
    Create-nocobase-app
  • Docker image version:
  • NodeJS version: 23.04

* How To Reproduce

Just upgrade nocobase to last version

Expected behavior

The upgrade was completed and can run the app

Screenshots

I attache a log from console

Loggs

{
event: ‘migrating’,
name: ‘20240802141435-collection-tree/@nocobase/plugin-collection-tree’
}
2025-03-17 03:22:59 [error] Migration 20240802141435-collection-tree/@nocobase/plugin-collection-tree (up) failed: Original error: Cannot read properties of undefined (reading ‘collectionSchema’) stack=MigrationError: Migration 20240802141435-collection-tree/@nocobase/plugin-collection-tree (up) failed: Original error: Cannot read properties of undefined (reading ‘collectionSchema’)
at (/home/automatizacion/nocobasetmb/node_modules/umzug/src/umzug.ts:261:17)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Umzug.runCommand (/home/automatizacion/nocobasetmb/node_modules/umzug/src/umzug.ts:210:14)
at async Object.up (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/lib/plugin-manager/plugin-manager.js:965:11)
at async _AsyncEmitter.upgrade (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/lib/application.js:719:5)
at async _AppCommand. (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/lib/commands/upgrade.js:36:5)
at async _AppCommand.parseAsync (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/node_modules/commander/lib/command.js:935:5)
at async _AsyncEmitter.runAsCLI (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/lib/application.js:526:23) module=application app=main reqId=8d9825e1-ae25-4818-8ca0-c8ab5c3433fa dataSourceKey=main
2025-03-17 03:22:59 [error] Cannot read properties of undefined (reading ‘collectionSchema’) stack=TypeError: Cannot read properties of undefined (reading ‘collectionSchema’)
at /home/automatizacion/nocobasetmb/node_modules/@nocobase/plugin-collection-tree/dist/server/migrations/20240802141435-collection-tree.js:79:57
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async (/home/automatizacion/nocobasetmb/node_modules/sequelize/src/sequelize.js:1197:18)
at async collection_tree_default.up (/home/automatizacion/nocobasetmb/node_modules/@nocobase/plugin-collection-tree/dist/server/migrations/20240802141435-collection-tree.js:59:5)
at async (/home/automatizacion/nocobasetmb/node_modules/umzug/src/umzug.ts:259:11)
at async Umzug.runCommand (/home/automatizacion/nocobasetmb/node_modules/umzug/src/umzug.ts:210:14)
at async Object.up (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/lib/plugin-manager/plugin-manager.js:965:11)
at async _AsyncEmitter.upgrade (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/lib/application.js:719:5)
at async _AppCommand. (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/lib/commands/upgrade.js:36:5)
at async _AppCommand.parseAsync (/home/automatizacion/nocobasetmb/node_modules/@nocobase/server/node_modules/commander/lib/command.js:935:5) app=main reqId=8d9825e1-ae25-4818-8ca0-c8ab5c3433fa
Done in 99.28s.
automatizacion@tmbappserver02:~/nocobasetmb$

Are you sure you’re using NocoBase version 1.5? Could you provide a screenshot of the exact version number? Normally, this migration file should only execute in versions ≤1.3.0-beta.

Hello.

Thanks for your reply.

I tried to confirm the version, but I encountered an error.
We work with three applications, all of which have been updated to version 1.5.12, but the main application is at version 1.2. How is this possible?

Main
image

Apps
image

Today I try a “yarn nocobase upgrade” I get the same error and nothing has updated.

Regards.

Hi, I have released a new version for fixing this issue, please try again.

1 Like

Hi.

Thanks, but th error still present.

error - ./node_modules/@nocobase/client/es/index.mjs:8290:12-28
export 'createHashRouter' (imported as 'createHashRouter') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createPath, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, parsePath, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)
error - ./node_modules/@nocobase/client/es/index.mjs:8291:15-34
export 'createBrowserRouter' (imported as 'createBrowserRouter') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createPath, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, parsePath, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)
error - ./node_modules/@nocobase/client/es/index.mjs:8292:14-32
export 'createMemoryRouter' (imported as 'createMemoryRouter') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createPath, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, parsePath, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)
error - ./node_modules/@nocobase/client/es/index.mjs:8300:12-25
export 'useRouteError' (imported as 'useRouteError') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createPath, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, parsePath, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)
error - ./node_modules/@nocobase/client/es/index.mjs:8311:175-189
export 'RouterProvider' (imported as 'RouterProvider') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createPath, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, parsePath, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)
new client connected PPx_s_o1NerNz9LsUwcjp
client tags: app#main

This is the screen.

Regards

This seems to be a different issue. How are you running it? Are you using create-nocobase-app?

Hello.

I’m using Node+Yarn on Ubuntu Server 24.04.2.

I did a fresh install and everything is working fine now.

Thanks, I now have version 1.6.14 on both the main and secondary applications.

Thanks again to the whole team, amazing work for the community!

Best regards.

1 Like