remix-graphql icon indicating copy to clipboard operation
remix-graphql copied to clipboard

Error thrown when consuming graphql

Open Cerchie opened this issue 2 years ago • 2 comments

Describe the bug

I'm running into an error once I set up remix and try to consume graphql with this package.

Your Example Website or App

https://github.com/Cerchie/remix-graphql-error

Steps to Reproduce the Bug or Issue

To replicate the issue I'm running into, on MacOS, I ran:

~ % npx create-remix@latest
Need to install the following packages:
  create-remix@latest
Ok to proceed? (y) y
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
? Where would you like to create your app? ./remix-experiment
? What type of app do you want to create? Just the basics
? Where do you want to deploy? Choose Remix if you're unsure; it's easy to 
change deployment targets. Remix App Server
? Do you want me to run `npm install`? Yes

I then ran npm run dev and the app worked.

The next thing I did was add a file called $username.tsx to the /routes folder, and copy-pasted the code for consuming graphql from the readme in this repository. I got this error:

 File changed: app/routes/$username.tsx
💿 Rebuilding...
💿 Rebuilt in 68ms
Error: Did you forget to run `remix setup` for your platform?
    at Object.<anonymous> (/Users/luciacerchie/remix-experiment/node_modules/remix/index.js:22:7)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/luciacerchie/remix-experiment/node_modules/remix-graphql/dist/index.js:35:21)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
GET / 500 - - 68.833 ms
^C

It's odd because my repository doesn't have that script as generated.

Expected behavior

I expected to see a 401 without the GitHub token, or expecting a 200 without it, but I'm seeing the above error (500) in my terminal instead.

Screenshots or Videos

No response

Javascript runtime version

v16.13.1

Deploy Target

No response

Operating System

MacOS Monterey

Additional context

No response

Cerchie avatar Jun 14 '22 13:06 Cerchie

Yup, receiving the same error. Perhaps might be related to usage of old versions of remix packages?

Inukares avatar Jul 21 '22 13:07 Inukares

I believe I'm running the latest packages, but I still get the error above.

 "dependencies": {
    "@prisma/client": "^4.1.0",
    "@remix-run/node": "^1.6.5",
    "@remix-run/react": "^1.6.5",
    "@remix-run/serve": "^1.6.5",
    "@remix-run/server-runtime": "^1.6.5",
    "bcryptjs": "^2.4.3",
    "date-fns": "^2.29.1",
    "graphql": "^16.5.0",
    "intl-parse-accept-language": "^1.0.0",
    "marked": "^4.0.18",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "remix-graphql": "^0.2.1",
    "tiny-invariant": "^1.2.0"
  },

soderlind avatar Jul 26 '22 12:07 soderlind