英文:
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
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
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论