Describe your question/issue in detail
I am following the steps given in GitHub - prismicio-community/course-glisten-next and when I run the command npm run set-up-content
then I am getting this Error:
TypeError: Cannot read properties of undefined (reading 'id')
Impacted feature
I am not able to find the exact issue behind this TypeError.
Errors
PS D:\demo-app> npm run set-up-content
> glisten-ai@0.1.0 set-up-content
> npx tsx@latest ./set-up-content.ts
Fetching source documents from "glisten-ai"...
Copying documents to "demo-app-lp"...
D:\Trading Minds\LandingPageClone\demo-app\node_modules\@prismicio\src\WriteClient.ts:401
const masterLocale = repository.languages.find((lang) => lang.is_master)!.id
^
TypeError: Cannot read properties of undefined (reading 'id')
at WriteClient.migrateCreateDocuments (D:\demo-app\node_modules\@prismicio\src\WriteClient.ts:401:74)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at WriteClient.migrate (D:\demo-app\node_modules\@prismicio\src\WriteClient.ts:295:9)
at main (d:\demo-app\set-up-content.ts:49:3)
Node.js v20.11.1
Package.json file
{
"name": "glisten-ai",
"version": "0.1.0",
"private": true,
"license": "Apache-2.0",
"author": "Prismic <contact@prismic.io> (https://prismic.io)",
"scripts": {
"dev": "concurrently \"npm:next:dev\" \"npm:slicemachine\" --names \"next,slicemachine\" --prefix-colors blue,magenta",
"next:dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"slicemachine": "start-slicemachine",
"format": "prettier --write .",
"set-up-content": "npx tsx@latest ./set-up-content.ts"
},
"dependencies": {
"@gsap/react": "^2.1.1",
"@prismicio/client": "^7.15.1",
"@prismicio/next": "^1.7.1",
"@prismicio/react": "^2.9.1",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"clsx": "^2.1.1",
"gsap": "^3.12.5",
"next": "^14.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"typescript": "^5.5.3"
},
"devDependencies": {
"@slicemachine/adapter-next": "^0.3.64",
"@tailwindcss/typography": "^0.5.13",
"autoprefixer": "^10.4.19",
"concurrently": "^8.2.2",
"eslint-config-next": "^14.2.5",
"postcss": "^8.4.39",
"prettier": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.5",
"slice-machine-ui": "^2.12.2",
"tailwindcss": "^3.4.4"
}
}