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

🧐[问题]项目执行npm run build 报错 #266

Closed
XPStone opened this issue Jul 5, 2024 · 6 comments
Closed

🧐[问题]项目执行npm run build 报错 #266

XPStone opened this issue Jul 5, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@XPStone
Copy link

XPStone commented Jul 5, 2024

🧐 问题描述

执行npm run build 报错,求助

image
执行npm install shiki@latest后再build,虽然显示build的成功,但proChat的版本改为^2.15.1,项目会爆红,改回^1.14.2后重新build会一样报错。

💻 示例代码

🚑 其他信息

@ONLY-yours ONLY-yours added the bug Something isn't working label Jul 5, 2024
@ONLY-yours
Copy link
Collaborator

嗯,2.x 版本还不能用的,所以只能用 1.x

@ONLY-yours
Copy link
Collaborator

新的 nextjs 确实有这个问题,我来解下

@ONLY-yours
Copy link
Collaborator

@XPStone 暂时不影响使用,记得标注为 'use client',我得看看 shiki 怎么做兼容 SSR

@XPStone
Copy link
Author

XPStone commented Jul 8, 2024

@XPStone 暂时不影响使用,记得标注为 'use client',我得看看 shiki 怎么做兼容 SSR
嗯,不影响开发,但暂时是没有办法部署

@XPStone
Copy link
Author

XPStone commented Jul 8, 2024

@XPStone 暂时不影响使用,记得标注为 'use client',我得看看 shiki 怎么做兼容 SSR

你好,如果我现在想build这个项目的话,您有什么方案吗?

@AmAzing129
Copy link
Collaborator

@XPStone 暂时不影响使用,记得标注为 'use client',我得看看 shiki 怎么做兼容 SSR

你好,如果我现在想build这个项目的话,您有什么方案吗?

next.js 增加配置:

const nextConfig = {
  transpilePackages: ['shiki'],
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants