为什么我在使用NetlifyCMS时无法在Netlify上部署我的Astro + React项目?

huangapple go评论69阅读模式
英文:

Why a can't deploy my Astro + React project on Netlify when i use NetlifyCMS?

问题

I try to deploy my website (Astro + React + Netlify CMS + Tailwind)
https://github.com/bernaul/baptiste-clisson

Since i add React on this commit, my deployment fail :
https://github.com/bernaul/baptiste-clisson/commit/58754f55618e5c206b2a604614df35c9396520c5

I don't understand the error :

12:52:58 AM: building client
12:52:58 AM: [vite]: Rollup failed to resolve import "netlify-cms-app" from "virtual:astro-netlify-cms/user-config".
12:52:58 AM: This is most likely unintended because it can break your application at runtime.
12:52:58 AM: If you do want to externalize this module explicitly add it to
12:52:58 AM: build.rollupOptions.external

为什么我在使用NetlifyCMS时无法在Netlify上部署我的Astro + React项目?

I use React 18 and astro-netlify-cms ...

Have you any advice ? Should I externalize "netlify-cms-app" ? How ?

Thank you for your help,
Have a nice day

I try to remove react but my application is broken...

英文:

I try to deploy my website (Astro + React + Netlify CMS + Tailwind)
https://github.com/bernaul/baptiste-clisson

Since i add React on this commit, my deployment fail :
https://github.com/bernaul/baptiste-clisson/commit/58754f55618e5c206b2a604614df35c9396520c5

I don't understand the error :

> 12:52:58 AM: building client
> 12:52:58 AM: [vite]: Rollup failed to resolve import "netlify-cms-app" from "virtual:astro-netlify-cms/user-config".
> 12:52:58 AM: This is most likely unintended because it can break your application at runtime.
> 12:52:58 AM: If you do want to externalize this module explicitly add it to
> 12:52:58 AM: build.rollupOptions.external

为什么我在使用NetlifyCMS时无法在Netlify上部署我的Astro + React项目?

I use React 18 and astro-netlify-cms ...

Have you any advice ? Should I externalize "netlify-cms-app" ? How ?

Thank you for your help,
Have a nice day

I try to remove react but my application is broken...

答案1

得分: 2

one quick fix: downgrading to React 17 and installing netlify-cms-app as a direct dependency does seem to fix this:

npm i {,@types/}{react,react-dom}@^17 netlify-cms-app

英文:

one quick fix: downgrading to React 17 and installing netlify-cms-app as a direct dependency does seem to fix this:

npm i {,@types/}{react,react-dom}@^17 netlify-cms-app

huangapple
  • 本文由 发表于 2023年2月18日 00:16:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75486751.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定