withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
47k stars 2.5k forks source link

impossible to build after upgrade to 2.8.0 #7605

Closed jojojojojoj5564656465465 closed 1 year ago

jojojojojoj5564656465465 commented 1 year ago

What version of astro are you using?

2.8.0

Are you using an SSR adapter? If so, which one?

static

What package manager are you using?

pnpm

What operating system are you using?

linux

What browser are you using?

chrome

Describe the Bug

I tried this repo before to upgrade, i can build it but after upgrade to 2.8.0 i have an error

Cannot read properties of undefined (reading 'set')

Cannot read properties of undefined (reading 'set')
  File:
    src/pages/blog/[slug].astro
  Stacktrace:
TypeError: Cannot read properties of undefined (reading 'set')
    at factory (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/2023-06-10-sample-gallery-post-markdoc.394cd6e2.mjs:64:26)
    at AstroComponentInstance.factory (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1131:12)
    at AstroComponentInstance.init (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1664:29)
    at AstroComponentInstance.render (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1669:18)
    at render.next (<anonymous>)
    at renderChild (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1727:18)
    at async EagerAsyncIterableIterator.next (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1486:14)
    at async renderChild (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1731:5)
    at async renderAstroTemplateResult (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1606:24)
    at async renderChild (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1725:5)
    at async renderSlot (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1751:5)
    at async renderSlotToString (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1761:20)
    at async Promise.all (index 0)
    at async renderSlots (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:1777:5)
    at async renderFrameworkComponent (file:///home/manjaro/DEV/sup/hello-astro/dist/chunks/astro.a9f939f3.mjs:2422:42)
    at async bufferHeadContent (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/runtime/server/render/page.js:44:25)
    at async renderPage (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/runtime/server/render/page.js:99:5)
    at async renderPage (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/core/render/core.js:41:18)
    at async generatePath (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/core/build/generate.js:446:20)
    at async generatePage (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/core/build/generate.js:206:5)
    at async generatePages (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/core/build/generate.js:133:7)
    at async staticBuild (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/core/build/static-build.js:84:7)
    at async AstroBuilder.build (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/core/build/index.js:118:5)
    at async AstroBuilder.run (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/core/build/index.js:149:7)
    at async build (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/core/build/index.js:37:3)
    at async runCommand (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/cli/index.js:219:14)
    at async cli (file:///home/manjaro/DEV/sup/hello-astro/node_modules/.pnpm/astro@2.8.0/node_modules/astro/dist/cli/index.js:260:5)

 ELIFECYCLE  Command failed with exit code 1.

What's the expected result?

i want to build with 2.8.0

Link to Minimal Reproducible Example

https://stackblitz.com/github.com/hellotham/hello-astro.git

Participation

bluwy commented 1 year ago

Seems like you need to upgrade @astrojs/markdoc too, it's using internal APIs that we're changing recently. Can you try that?

jojojojojoj5564656465465 commented 1 year ago

i update everything and still not working

 error   `.astro` files are no longer supported in the Markdoc config.
  Hint:
    Use the `component()` utility to specify a component path instead.
  File:
    /home/manjaro/DEV/POUBELLE/hello-astro/node_modules/.pnpm/@astrojs+markdoc@0.4.1_astro@2.8.0/node_modules/@astrojs/markdoc/dist/load-config.js:54:28
  Code:
    53 |           build.onResolve({ filter: /.*\.astro$/ }, () => {
    > 54 |             markdocError = new MarkdocError({
         |                            ^
      55 |               message: "`.astro` files are no longer supported in the Markdoc config.",
      56 |               hint: "Use the `component()` utility to specify a component path instead."
      57 |             });`
{
  "name": "hello-astro",
  "description": "Hello Astro is a full featured Astro corporate/marketing/blog starter theme written in Typescript and TailwindCSS. It supports Markdown and MDX based pages and blog posts.",
  "version": "1.0.1",
  "scripts": {
    "dev": "astro dev",
    "clean": "rm -rf node_modules .astro dist",
    "start": "astro dev",
    "build": "astro build",
    "preview": "astro preview",
    "check": "astro check",
    "lint": "pnpm run lint:prettier ; pnpm run lint:eslint",
    "lint:prettier": "prettier --write  \"src/**/*.{js,jsx,ts,tsx,md,mdx,astro}\"",
    "lint:eslint": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\"",
    "astro": "astro"
  },
  "devDependencies": {
    "@akebifiky/remark-simple-plantuml": "^1.0.2",
    "@astrojs/alpinejs": "^0.2.2",
    "@astrojs/mdx": "^0.19.7",
    "@astrojs/sitemap": "^1.3.3",
    "@astrojs/tailwind": "^4.0.0",
    "@tailwindcss/aspect-ratio": "^0.4.2",
    "@tailwindcss/forms": "^0.5.3",
    "@tailwindcss/line-clamp": "^0.4.4",
    "@tailwindcss/typography": "^0.5.9",
    "@types/alpinejs": "^3.7.2",
    "@types/leaflet": "^1.9.3",
    "@types/photoswipe": "^4.1.2",
    "@typescript-eslint/parser": "^5.61.0",
    "alpinejs": "^3.12.3",
    "astro": "^2.8.0",
    "astro-robots-txt": "^0.5.0",
    "eslint": "^8.44.0",
    "eslint-plugin-astro": "^0.27.2",
    "eslint-plugin-css": "^0.8.0",
    "eslint-plugin-jsx-a11y": "^6.7.1",
    "eslint-plugin-markdown": "^3.0.0",
    "eslint-plugin-mdx": "^2.1.0",
    "exifr": "^7.1.3",
    "mdast-util-to-string": "^4.0.0",
    "prettier": "^3.0.0",
    "prettier-config-standard": "^5.0.0",
    "prettier-plugin-astro": "^0.10.0",
    "prettier-plugin-tailwindcss": "^0.3.0",
    "reading-time": "^1.5.0",
    "rehype-katex": "^6.0.3",
    "remark-emoji": "^3.1.2",
    "remark-math": "^5.1.1",
    "schema-dts": "^1.1.2",
    "tailwindcss": "^3.3.2",
    "typescript": "~5.1.6",
    "unist-util-visit": "^5.0.0"
  },
  "dependencies": {
    "@astrojs/markdoc": "^0.4.1",
    "@astrojs/rss": "^2.4.3",
    "astro-icon": "^0.8.1",
    "astro-seo": "^0.7.4",
    "hero-patterns": "^2.1.0",
    "katex": "^0.16.8",
    "leaflet": "^1.9.4",
    "lunr": "^2.3.9",
    "photoswipe": "^5.3.8",
    "photoswipe-dynamic-caption-plugin": "^1.2.7",
    "swiper": "^10.0.4"
  },
  "packageManager": "pnpm@8.5.1"
}
ematipico commented 1 year ago

@jojojojojoj5564656465465 have you tried to follow the instructions given by the error?

Here's the migration path https://github.com/withastro/astro/blob/main/packages/integrations/markdoc/CHANGELOG.md#migration

You will need to update this file https://github.com/hellotham/hello-astro/blob/main/markdoc.config.mjs