Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error occurred ReferenceError: Cannot access 'api' before init #193

Open
stelasido opened this issue May 15, 2023 · 1 comment
Open

Comments

@stelasido
Copy link

npm i
yarn

npm run build
yarn build

and that error:
`
1:/var/www/blog/next-cms-ghost$ npm run build

next-cms-ghost@1.0.0 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=......

@deelo55
Copy link

deelo55 commented May 25, 2024

I'm getting the same

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

No branches or pull requests

2 participants