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

TypeError: Failed to parse URL from /api/tina/gql #114

Open
avcohen opened this issue Jan 17, 2024 · 4 comments
Open

TypeError: Failed to parse URL from /api/tina/gql #114

avcohen opened this issue Jan 17, 2024 · 4 comments

Comments

@avcohen
Copy link

avcohen commented Jan 17, 2024

Cloned repo, followed setup instructions to a T.

As noted in title, getting an error at first run of the starter.

 ⨯ TypeError: Failed to parse URL from /api/tina/gql
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async TinaClient.request (file:///Users/aaroncohen/dev/web/handstand/node_modules/tinacms/dist/client.mjs:33:17)
    at async requester (webpack-internal:///./tina/__generated__/types.ts:193:22)
    at async getStaticProps (webpack-internal:///./pages/index.tsx:43:23) {
  page: '/',
  [cause]: TypeError: Invalid URL
      at new URL (node:internal/url:775:36)
      at new Request (node:internal/deps/undici/undici:5270:25)
      at fetch (node:internal/deps/undici/undici:9508:25)
      at Object.fetch (node:internal/deps/undici/undici:11728:18)
      at fetch (node:internal/process/pre_execution:314:27)
      at TinaClient.request (file:///Users/aaroncohen/dev/web/handstand/node_modules/tinacms/dist/client.mjs:33:23)
      at requester (webpack-internal:///./tina/__generated__/types.ts:193:35)
      at Object.page (webpack-internal:///./tina/__generated__/types.ts:177:20)
      at getStaticProps (webpack-internal:///./pages/index.tsx:43:100)
      at /Users/aaroncohen/dev/web/handstand/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:4070
      at /Users/aaroncohen/dev/web/handstand/node_modules/next/dist/server/lib/trace/tracer.js:133:36
      at NoopContextManager.with (/Users/aaroncohen/dev/web/handstand/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
      at ContextAPI.with (/Users/aaroncohen/dev/web/handstand/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
      at NoopTracer.startActiveSpan (/Users/aaroncohen/dev/web/handstand/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18093)
      at ProxyTracer.startActiveSpan (/Users/aaroncohen/dev/web/handstand/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18854) {
    code: 'ERR_INVALID_URL',
    input: '/api/tina/gql'
@little-inferno
Copy link

little-inferno commented Mar 3, 2024

I fixed this problem by setting contentApiUrlOverride to http://localhost:4001/graphql

@alexis2m
Copy link

alexis2m commented Apr 3, 2024

This is a good answer, but in order to provide more flexibility, i used process.env.NEXT_PUBLIC_SITE_URL+"/api/tina/gql".

@abhishek-mittal
Copy link

Hi, can't we have tina gql api wrapped in app/router since what I am seeing is the next build is not working, when I try to put it in prod.

@v4iv
Copy link

v4iv commented Jan 16, 2025

I fixed this problem by setting contentApiUrlOverride to http://localhost:4001/graphql

It's working but I don't really understand why, can you point me to any resources or explanations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants