Closed galois-dev closed 4 years ago
I get an error telling me to polyfill my fucking server because something in this pacakage wont run with es5-6 and it requires es5-6.
You need to install fucking reflect-metadata
package as described in the fucking installation docs:
https://typegraphql.com/docs/installation.html
This shit also describes that you need to configure your TS to es2018
and run on the Node.js LTS (10.3+, 12+) that supports this es target.
works like fucking described
Just a note:
If you are running into issues with tsc and trying to run a script, import 'reflect-metadata' directly into the fucking script file.
Another comment on this: place this import on top to avoid other reflection issues 😬
Just a note:
If you are running into issues with tsc and trying to run a script, import 'reflect-metadata' directly into the fucking script file.
Why isn't this fucking shit on the Prisma site? https://prisma.typegraphql.com/docs/basics/installation
@eglove You need to read this fucking docs properly to make this fucking shit working well:
Well, fuck me for not reading. Thank you.
For people passing the fuck by trying to get jest
to behave you need to do some additional shit. First, create a setup file with this:
import 'reflect-metadata';
and then fucking update your jest config:
const config = {
setupFilesAfterEnv: ["<rootDir>/jest-setup.js"],
};
export default config;
You can now test your shit
Sorry for necro, but this just made my fucking day
LOL F@cking Thread!
Let this thread be a cautionary tale. Two years later and this ragepost is still farming the lolz at my expense.
Oh my god, this is the first time ever I found such a heart-warming thread, thanks guys for making my day! 2 years later and still the same issue with fucking typegraphql. Error only there when I tried to do jest test, it is working fine in the local run. Solved by import reflect-metadata at the top of files where I registered the enum.
I get an error telling me to polyfill my fucking server because something in this pacakage wont run with es5-6 and it requires es5-6.
You need to install fucking
reflect-metadata
package as described in the fucking installation docs: https://typegraphql.com/docs/installation.htmlThis shit also describes that you need to configure your TS to
es2018
and run on the Node.js LTS (10.3+, 12+) that supports this es target.
I mean the docs don't fucking say you need it for JEST testing tho 😉
This is the funniest fucking issue thread I've ever come across.
best fucking post ever
most normal software engineer discussion
very interesting discussion
here for fun
Spicy thread
here for fun, from twitter
Describe the Bug A clear and concise description of what the bug is. I get an error telling me to polyfill my fucking server because something in this pacakage wont run with es5-6 and it requires es5-6. I run no business logic, no code literally just importing this breaks my server. Everything else runs fine.
To Reproduce A quick guide how to reproduce the bug. You can paste here code snippets or even better, provide a link to the repository with minimal reproducible code example.
Import the package
Expected Behavior A clear and concise description of what you expected to happen.
Nothing, no code is run its just fucking bricked from import
Logs If applicable, add some console logs to help explain your problem. You can paste the errors with stack trace that were printed when the error occured.
[INFO] 15:53:29 Restarting: /Users/benjamin/PycharmProjects/VscodeProjects/dinasite/backend/src/main.ts has been modified Error: Looks like you've forgot to provide experimental metadata API polyfill. Please read the installation instruction for more details.
at Object.ensureReflectMetadataExists (/Users/benjamin/PycharmProjects/VscodeProjects/dinasite/backend/node_modules/type-graphql/dist/metadata/utils.js:41:15) at new MetadataStorage (/Users/benjamin/PycharmProjects/VscodeProjects/dinasite/backend/node_modules/type-graphql/dist/metadata/metadata-storage.js:26:17) at Object.getMetadataStorage (/Users/benjamin/PycharmProjects/VscodeProjects/dinasite/backend/node_modules/type-graphql/dist/metadata/getMetadataStorage.js:5:87) at Resolver.target (/Users/benjamin/PycharmProjects/VscodeProjects/dinasite/backend/node_modules/type-graphql/dist/decorators/Resolver.js:19:30) at __decorate (/Users/benjamin/PycharmProjects/VscodeProjects/dinasite/backend/src/domain/user/user.resolver.ts:5:95) at /Users/benjamin/PycharmProjects/VscodeProjects/dinasite/backend/src/domain/user/user.resolver.ts:10:26 at Object.Environment (please complete the following information):
Additional Context Add any other context about the problem here.