next-cms-ghost
next-cms-ghost copied to clipboard
Build error occurred ReferenceError: Cannot access 'api' before init
npm i yarn
npm run build yarn build
and that error: ` 1:/var/www/blog/next-cms-ghost$ npm run build
[email protected] build next build
info - Loaded env from /var/www/blog/next-cms-ghost/.env.local
info - Checking validity of types
info - Creating an optimized production build
info - Compiled successfully
Build error occurred ReferenceError: Cannot access 'api' before initialization at getAllPosts (/var/www/blog/next-cms-ghost/.next/server/chunks/393.js:454:19) at getStaticPaths (/var/www/blog/next-cms-ghost/.next/server/pages/[...slug].js:1591:90) at buildStaticPaths (/var/www/blog/next-cms-ghost/node_modules/next/dist/build/utils.js:498:37) at /var/www/blog/next-cms-ghost/node_modules/next/dist/build/utils.js:641:125 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Span.traceAsyncFn (/var/www/blog/next-cms-ghost/node_modules/next/dist/trace/trace.js:75:20) { type: 'ReferenceError' }`
`lsb_release -a
Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04
NVM with a supported for GhostCMS version 18.6 or above, it doesn't matter.
.env.local: CMS_GHOST_API_URL=...... CMS_GHOST_API_KEY=......
I'm getting the same