Run command like bun astro-pure info, bun astro info
Astro Theme Pure
Information:
- Package: 1.4.2
- Node.js: v24.14.1
- Platform: win32
$ astro info
22:41:28 [vite] (ssr) Error when evaluating SSR module D:\pure\astro-theme-pure-4.1.4\astro.config.ts: Cannot find package '@unocss/astro' imported from D:\pure\astro-theme-pure-4.1.4\node_modules\unocss\dist\astro.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:301:9)
at packageResolve (node:internal/modules/esm/resolve:768:81)
at moduleResolve (node:internal/modules/esm/resolve:859:18)
at defaultResolve (node:internal/modules/esm/resolve:991:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:719:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:736:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:765:52)
at #resolve (node:internal/modules/esm/loader:701:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:621:35)
at ModuleJob.syncLink (node:internal/modules/esm/module_job:160:33)
[astro] Unable to load your Astro config
Cannot find package '@unocss/astro' imported from D:\pure\astro-theme-pure-4.1.4\node_modules\unocss\dist\astro.mjs
Stack trace:
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:301:9)
at moduleResolve (node:internal/modules/esm/resolve:859:18)
at #cachedDefaultResolve (node:internal/modules/esm/loader:719:20)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:765:52)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:621:35)
error: script "astro" exited with code 1
Describe the Bug
使用 Release v4.1.4 时,如果按照文档推荐的方式完全移除本地 packages 下的 pure 包,转而由包管理器获取并安装 v1.4.2 版本的 astro-pure 时,整体无法正常工作。
运行 astro check、astro build、astro dev 等都会出现与上面所附的 astro info 的结果一致的错误。
除此之外,使用 VSCode 编辑时还可以看到一些来自 TypeScript 的奇怪的错误。例如下面的错误来自 src/site.config.ts,似乎这部分代码本来不应该有错误。
src/site.config.ts: 类型“{ github: string; }”缺少类型“Record<"github" | "gitlab" | "discord" | "youtube" | "instagram" | "x" | "telegram" | "rss" | "email" | "reddit" | "bluesky" | "tiktok" | "weibo" | "steam" | "bilibili" | "zhihu" | "coolapk" | "netease", string>”的以下属性: gitlab, discord, youtube, instagram 及其他 13 项。
node_modules/astro-pure/types/theme-config.ts: 所需类型来自属性 "social",在此处的 "{ year: string; links?: { title: string; link: string; style?: string | undefined; pos?: number | undefined; }[] | undefined; credits?: boolean | undefined; social?: Record<"github" | "gitlab" | ... 15 more ... | "netease", string> | undefined; }" 类型上声明该属性
还注意到用这种方式安装时,会出现一行警告 warn: incorrect peer dependency "@emnapi/runtime@1.7.0",而任一可以正常工作的方式或版本(见后)下并不会有这行警告。
bun install v1.3.11 (af24e281)
warn: incorrect peer dependency "@emnapi/runtime@1.7.0"
+ @ianvs/prettier-plugin-sort-imports@4.7.1
+ @typescript-eslint/parser@8.56.1 (v8.58.0 available)
+ eslint@9.39.3 (v10.2.0 available)
+ eslint-plugin-astro@1.6.0
+ prettier@3.8.1
+ prettier-plugin-astro@0.14.1
+ @astrojs/check@0.9.6
+ @astrojs/rss@4.0.15 (v4.0.18 available)
+ @astrojs/vercel@9.0.4 (v10.0.4 available)
+ @waline/client@3.12.2 (v3.13.0 available)
+ astro@5.17.3 (v6.1.4 available)
+ astro-pure@1.4.2
+ katex@0.16.33 (v0.16.45 available)
+ rehype-katex@7.0.1
+ remark-math@6.0.0
+ sharp@0.34.5
+ typescript@5.9.3
725 packages installed [10.20s]
Removed: 1
可以正常工作的方式
如果参照文档中的 Package Mode 部署方式,链接并使用 packages 下的包,或者保留原始 packages.json 中的 workspaces 配置直接使用,都不会出现这一问题。
前一个版本,即 Release v4.1.3(和 astro-pure 的... v1.4.0?上个 Release 中的 package.json 好像没有修改 astro-pure 的版本号)不存在此问题。无论以哪种方式都可以正常工作。
If this issue only occurs in one browser, which browser is a problem?
No response
Participation
Run command like
bun astro-pure info,bun astro infoDescribe the Bug
使用 Release
v4.1.4时,如果按照文档推荐的方式完全移除本地packages下的pure包,转而由包管理器获取并安装v1.4.2版本的astro-pure时,整体无法正常工作。运行
astro check、astro build、astro dev等都会出现与上面所附的astro info的结果一致的错误。除此之外,使用 VSCode 编辑时还可以看到一些来自 TypeScript 的奇怪的错误。例如下面的错误来自
src/site.config.ts,似乎这部分代码本来不应该有错误。还注意到用这种方式安装时,会出现一行警告
warn: incorrect peer dependency "@emnapi/runtime@1.7.0",而任一可以正常工作的方式或版本(见后)下并不会有这行警告。可以正常工作的方式
如果参照文档中的 Package Mode 部署方式,链接并使用
packages下的包,或者保留原始packages.json中的workspaces配置直接使用,都不会出现这一问题。前一个版本,即 Release
v4.1.3(和astro-pure的...v1.4.0?上个 Release 中的package.json好像没有修改astro-pure的版本号)不存在此问题。无论以哪种方式都可以正常工作。If this issue only occurs in one browser, which browser is a problem?
No response
Participation