tinacms / tinacms

A fully open-source headless CMS that supports Markdown and Visual Editing
https://tina.io
Apache License 2.0
11.19k stars 564 forks source link

Not sure why I get this error message with Vite + AstroJS + TinaCMS #4430

Open astrawnuts opened 3 months ago

astrawnuts commented 3 months ago

Describe the issue that you're seeing. Any Loom videos or screenshots usually help a lot!

I am opting for Tina Cloud with latest version of Astro JS.

I am getting this error message when trying to build using the build command: tinacms build && yarn generate-json && astro build

Thank you in advance

`

13:07:11.656 | 24:07:11 [ERROR] [vite] Could not resolve "../../../../tina/__generated__/databaseClient" from "src/pages/api/tina/[...routes].ts"
-- | --
xxxxxxxxxxxx | file: /opt/buildhome/repo/src/pages/api/tina/[...routes].ts
xxxxxxxxxxxx  | Could not resolve "../../../../tina/__generated__/databaseClient" from "src/pages/api/tina/[...routes].ts"
xxxxxxxxxxxx  | Stack trace:
xxxxxxxxxxxx  | at error (file:///opt/buildhome/repo/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
xxxxxxxxxxxx  | at file:///opt/buildhome/repo/node_modules/rollup/dist/es/shared/node-entry.js:17982:26
xxxxxxxxxxxx  | Failed: Error while executing user command. Exited with error code: 1
xxxxxxxxxxxx | Failed: build command exited with code: 1
xxxxxxxxxxxx  | Failed: error occurred while running build command

`

Reproduction

https://github.com/zeon-studio/astroplate

Steps to reproduce

setup tina cms + astro js template

  1. https://github.com/zeon-studio/astroplate
  2. clone repo above
  3. setup tina cms using tina cloud
  4. change config based on repo and blog content folder
  5. add in build commands in package.json
  6. setup tina cloud project
  7. push project to github
  8. try and build build will fail

System Info

windows 10

Validations

kldavis4 commented 3 months ago

there's too many steps in your reproduction - put a branch up with tina already configured and we can take a look