Passing strings for MessageEmbed#setFooter is deprecated - discord

I'm getting this warning in the terminal when running my bot code:
(node:6220) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead.(Use node --trace-deprecation ... to show where the warning was created)

D.JS v13 changes
// you used:
embed.setFooter("test")
// in discord.js v13:
embed.setFooter({
text: "test"
})

Related

How do I find where 'given node is not an Element, the node type is: string' error occurred from stack trace? (react/JS)

I'm writing a react app as a practice and I get the following error on several components, however I can't see that it tells me where it comes from? It doesn't prevent tests (jest/react testing library) passing or indeed build (WIP app is successfully deployed to netlify). Nevertheless, I'd like to track it down if only for understanding:
Error: The given node is not an Element, the node type is: string.
at getWindowFromNode (/Users/learning/Documents/projects/mol-bio-tools/node_modules/#testing-library/dom/dist/helpers.js:58:11)
at hasPointerEvents (/Users/learning/Documents/projects/mol-bio-tools/node_modules/#testing-library/user-event/dist/utils/misc/hasPointerEvents.js:11:49)
at click (/Users/learning/Documents/projects/mol-bio-tools/node_modules/#testing-library/user-event/dist/click.js:116:63)
at typeImplementation (/Users/learning/Documents/projects/mol-bio-tools/node_modules/#testing-library/user-event/dist/type/typeImplementation.js:24:36)
at Object.type (/Users/learning/Documents/projects/mol-bio-tools/node_modules/#testing-library/user-event/dist/type/index.js:27:60)
at Object.<anonymous> (/Users/learning/Documents/projects/mol-bio-tools/src/__tests__/transcribe.test.js:33:15)
at Promise.then.completed (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/utils.js:391:28)
at new Promise (<anonymous>)
at callAsyncCircusFn (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/utils.js:316:10)
at _callCircusTest (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/run.js:218:40)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at _runTest (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/run.js:155:3)
at _runTestsForDescribeBlock (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/run.js:66:9)
at _runTestsForDescribeBlock (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/run.js:60:9)
at run (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/run.js:25:3)
at runAndTransformResultsToJestFormat (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21)
at jestAdapter (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
at runTestInternal (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-runner/build/runTest.js:389:16)
at runTest (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-runner/build/runTest.js:475:34)
at Object.worker (/Users/learning/Documents/projects/mol-bio-tools/node_modules/jest-runner/build/testWorker.js:133:12)
Current complete code is here and live app is here (again: WIP - I know various links/etc don't work yet).
Turns out if I actually read that trace it highlights an error in my test:
at Object.<anonymous> (/Users/learning/Documents/projects/mol-bio-tools/src/__tests__/transcribe.test.js:33:15)
Turns out I'd managed to use a hybrid of #testing-library/userevent v13.5 and v14 syntax, and there are breaking changes between the 2 versions. Updated to v14, updated syntax, all good.

Importing markdown in react caused "marked is not a function" or The "data" argument ... error

I know there are lots of "marked is not a function" questions, but they don't solve my problem, hence here is the question.
Previously I think I npm i marked and npm i react-markdown, then I try to include markdown using the solution How do I load a markdown file into a react component?
However, I keep getting either of these error:
🚨 The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received null
at new NodeError (internal/errors.js:322:7)
at Hash.update (internal/crypto/hash.js:84:11)
at Bundle.getHash (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundle.js:301:12)
at Bundle.package (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundle.js:186:23)
at Bundle.package (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundle.js:198:30)
at Bundle.package (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundle.js:198:30)
at Bundler.bundle (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundler.js:325:49)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Timeout._onTimeout (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundler.js:817:7)
Or
🚨 /home/azureuser/NCD_demo/main_project/src/webpages/assets/posts.md: marked is not a function
at MarkdownAsset.generate (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/assets/MarkdownAsset.js:12:12)
at async MarkdownAsset.process (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Asset.js:217:24)
at async Pipeline.processAsset (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Pipeline.js:46:7)
at async Pipeline.process (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Pipeline.js:24:23)
at async Object.run (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/worker.js:15:12)
at async Bundler.loadAsset (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundler.js:577:19)
at async /home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundler.js:610:13
at async Promise.all (index 4)
at async Bundler.loadAsset (/home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundler.js:599:21)
at async /home/azureuser/NCD_demo/main_project/node_modules/parcel-bundler/src/Bundler.js:610:13
I got the first error if I run npm run dev then I uncomment this line, after which it reloads itself
const content = require('./assets/posts.md');
Then I got the latter error if I don't comment it, CTRL+C the previous npm dev run, then npm dev run again with it uncommented.
I got the same error if I do this instead:
import file from "./assets/posts.md";
I even try to
Without the line, everything runs fine.
I even tried remove package-lock.json and node_modules, remove the dependencies for React-markdown and marked packages (so they don't get installed), but I still got the similar problem: Except that I don't get the first error but white screen of death.
Anyone encountered the same problem before could help me understand what is happening with this? Which error code is correct and how should I fix it?
Thanks in advance.

typescript relay reactjs IRTransformer: Unknown kind `undefined`. using hasura

Hi i got this error which i got before, but i forgot how i solved it.
I created a new query for Relay but I get this error. I remember it has to do something with Typescript, but not sure what i did wrong.
ERROR:
IRTransformer: Unknown kind `undefined`.
error Command failed with exit code 100.
It is not pointing to a particular place in my code, so not sure which code snippet i should include...
this is the query (but it could easily be another one):
const getEvent = `query CreateEventQuery {
eetschema_event_connection(where: {group_id: {_eq: "17ee3ff5-eae1-4482-9ad6-d791a46a9799"}}) {
edges {
node {
name
}
}
}
}
`;
script I run is yarn relay and the problem is at the yarn-compile step
"export-schema": "get-graphql-schema https://XXXX.hasura.app/v1beta1/relay -h 'x-hasura-admin-secret=XXXXX' > ./schema.graphql",
"relay-compile": "relay-compiler --src=./src --schema=./schema.graphql --language typescript ",
"relay": "npm run export-schema && npm run relay-compile",
Somehow reinstalling the relay compiler worked for me.
yarn add relay-compiler-language-typescript

next.js npm module comment giving an error

This is my error
10:03:56.049 ./components/navbar.js
10:03:56.049 13:33 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
10:03:56.049 39:33 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
10:03:56.049 Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
10:03:56.051 info - Creating an optimized production build...
10:04:04.307 Failed to compile.
10:04:04.308 HookWebpackError: Unexpected '/'. Escaping special characters with \ may help.
10:04:04.308 > Build error occurred
10:04:04.309 Error: > Build failed because of webpack errors
10:04:04.309 at /vercel/path0/node_modules/next/dist/build/index.js:15:924
10:04:04.309 at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:6:584)
10:04:04.333 Error: Command "npm run build" exited with 1
At first I thought it was coming from navbar.js but I don't see any "special characters" there, here is my navbar.js: https://pastebin.com/8XFUtL5A
So then I went and checked node_modules/next/dist/telemetry/trace/trace.js:6:584 and I found a lot of comments there: https://pastecord.com/epygazosib.js
So how do I solve this error? Because I saw a similar error someone else had but they are using angular
I have fixed this by simply removing all the comments in all my css files
In my case I made a mistake in the comments in my stylesheet page.
I had something like this
/*/*Comment*/
*/.className{
}
so removing the comment solved the bug for me.
/*Comment*/
.className{
}

Error running sample "Twilio Video React App". getting error - Argument of type 'null' is not assignable to parameter of type 'Priority'. TS2345

I was trying to run the sample Twilio Video React App taken from https://github.com/twilio/twilio-video-app-react
I have installed npm and all dependencies required for the project. When I do npm start I get the error -
Files successfully emitted, waiting for typecheck results...
Failed to compile. I:/Project/twilio-video-app-react-master/src/components/VideoTrack/VideoTrack.tsx
TypeScript error in I:/Project/twilio-video-app-react-master/src/components/VideoTrack/VideoTrack.tsx(36,27):
Argument of type 'null' is not assignable to parameter of type 'Priority'. TS2345
if (track.setPriority && priority) {
// Passing `null` to setPriority will set the track's priority to that which it was published with.
track.setPriority(null);
}
But when I look at the documentation https://www.twilio.com/docs/video/tutorials/using-track-priority-api, I see they use setPriority(null).
Is there anything I am missing. I have not done any changes to the sample yet!

Resources