Meteor/React: Your app is crashing but fixed error? - reactjs

I keep getting this error below but when I update the Resolutions.graphql file to correct the typo, I still get the error.
Tried restarting the Meteor server but still receiving the error.
Anything I'm missing?
Error: Unknown type "Sting". Did you mean "String"?
at assertValidSDL (/Users/macos/apollo/node_modules/graphql/validation/validate.js:89:11)
at Object.buildASTSchema (/Users/macos/apollo/node_modules/graphql/utilities/buildASTSchema.js:76:34)
at Object.buildSchemaFromTypeDefinitions (/Users/macos/apollo/node_modules/graphql-tools/dist/generate/buildSchemaFromTypeDefinitions.js:23:28)
at makeExecutableSchema (/Users/macos/apollo/node_modules/graphql-tools/dist/makeExecutableSchema.js:26:29)
at register-api.js (imports/startup/server/register-api.js:22:16)
at fileEvaluate (packages/modules-runtime.js:336:7)
at Module.require (packages/modules-runtime.js:238:14)
at Module.moduleLink [as link] (/Users/macos/.meteor/packages/modules/.0.13.0.1pfv79d.ujmak++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:38:38)
at index.js (imports/startup/server/index.js:1:8)
at fileEvaluate (packages/modules-runtime.js:336:7)
at Module.require (packages/modules-runtime.js:238:14)
at Module.moduleLink [as link] (/Users/macos/.meteor/packages/modules/.0.13.0.1pfv79d.ujmak++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:38:38)
at init.js (server/init.js:1:8)
at fileEvaluate (packages/modules-runtime.js:336:7)
at Module.require (packages/modules-runtime.js:238:14)
at require (packages/modules-runtime.js:258:21)
Exited with code: 1
Your application is crashing. Waiting for file change.
Resolutions.graphql:
type Resolutions {
_id: String!
name: String!
}

Finally got it to work using meteor reset instead of just cmd + c and then meteor

Related

Invalid bitfield flag or number: undefined

So i went to start my discord.js bot and then this error shown.
throw new RangeError('BITFIELD_INVALID', bit);
^
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefined.
at Function.resolve (/home/container/node_modules/discord.js/src/util/BitField.js:152:11)
at /home/container/node_modules/discord.js/src/util/BitField.js:147:54
at Array.map (<anonymous>)
at Function.resolve (/home/container/node_modules/discord.js/src/util/BitField.js:147:40)
at Client._validateOptions (/home/container/node_modules/discord.js/src/client/Client.js:546:33)
at new Client (/home/container/node_modules/discord.js/src/client/Client.js:73:10)
at Object.<anonymous> (/home/container/index.js:4:16)
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) {
[Symbol(code)]: 'BITFIELD_INVALID'}
Can anyone help at all, a list of my commands can be found at https://github.com/Makuta24/commands
Thanks in advance! Ps i do not know what code made this error occur therefor i linked all of the commands on the server, sorry.
An error I noticed on your code, is that you are requesting permissions with the hasPermission() modal. In v13 (version I suppose you are using), this modal is deprecated.
Here is a solution that may work for you:
const { MessageEmbed, Permissions } = require('discord.js');
if (!message.member.permissions.has([Permissions.FLAGS.MANAGE_CHANNELS])) {
return message.channel.send('Wait, you cannot lock channels!')
}
What I am doing here is requesting the Permissions object from the Discord.js library, to use it with your chosen flag (FLAGS.MANAGE_CHANNELS), and then checking if it has the flag you expect with the has() modal.
This is only what I saw on the command's code, though. Your error log shows an error on index.js:4:16, so it may be a good idea to share your index.js file to see if there are other errors present on it.

'SyntaxError: Cannot use import statement outside a module' after first successful Next.js compiling

I'm using a library for React/Next.js with typescript to fetch Instagram media from posts called react-instagram-media for a website project.
The package's Docs says to import the component with...
import { InstagramMedia } from 'react-instagram-media';
The component compiles the first time without problems as I run yarn dev command. It renders correctly on hocalhost:3000/ but after saving any file and hot-reloading (even with no changes applied) or refreshing the browser tab, it throws this error:
..\node_modules\react-instagram-media\src\index.js:1
import instagramMediaParser from './helpers/instagramMediaParser'
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.react-instagram-media (D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:1555:18)
at __webpack_require__ (D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:23:31)
at Module../src/components/InstagramPost.tsx (D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:762:79)
at __webpack_require__ (D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:23:31)
at Module../src/components/IgPostsBanner.tsx (D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:714:72)
at __webpack_require__ (D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:23:31)
at Module../src/pages/index.tsx (D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:1261:83)
at __webpack_require__ (D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:23:31)
at D:\Dev\ZULIA\zuliaweb\.next\server\pages\index.js:91:18
The file referenced ..\node_modules\react-instagram-media\src\index.js:1 only has this:
import instagramMediaParser from './helpers/instagramMediaParser'
import InstagramMedia from './components/InstagramMedia'
export {
instagramMediaParser,
InstagramMedia
}
... and its the same code during the first successful and all subsecuent failing compilings, as far as I could check.
The only way I've found to successfully compile it again is to remove (or comment out) the import statement and its imported component and recompile it again (by hot-reloading). It doesnt matter where I use the import statement and Component (at index.tsx or any sub-level), it always crashes after the first successful compiling.
I'm new to Next and typescript so any help would be appreciated. Thanks!

I've been stuck with this error for like 2 weeks, I still haven't managed to fix it

So I have updated my help command so that way the menu will be much cleaner and more up to date than my old one. However whenever I replace my old code with my new one I end up getting this Error and I can't seem to figure it out. I've tried commenting out different pieces of my command handler to see whether that fixes it but I had no luck. I've never had this before though. cmd.execute(bot, message, args) is only in the message.js event file apart from the handler. but even when I add that line of code into the file, it doesn't remove the error? it works fine on my old help code though. I also logged cmd in the command.js file in the handler after I defined cmd and it logs all the cmd info right above the error.
I have the cmd.execute(args, message, bot) that is being logged saying that I need it further down under where I define cmd in the help file, its the only file that is throwing the issue and it only happens if I use the new help.js menu.
Error:
TypeError: [ERROR][COMMANDS]: execute function is required for commands! (help.js)
at /home/runner/RocketBot/utils/command.js:18:15
at Array.forEach (<anonymous>)
at module.exports (/home/runner/RocketBot/utils/command.js:8:23)
at Object.<anonymous> (/home/runner/RocketBot/index.js:19:30)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:132)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
Files
Old Help Command: https://hasteb.in/tuhiduvi.js
New Help Command: https://hasteb.in/awiyafap.js
command.js: https://hasteb.in/ebuduyuv.js
message.js: https://hasteb.in/oviwuvix.js

"react-meteor-data" gives error with react 16

I am using react 16 with meteor.
I am using react-meteor-data package for using "withtracker".
But this package gives this issue
TypeError: Class extends value undefined is not a constructor or null
at ReactMeteorData.jsx (packages/react-meteor-data/ReactMeteorData.jsx:162:36)
at fileEvaluate (packages/modules-runtime.js:322:7)
at Module.require (packages/modules-runtime.js:224:14)
at require (packages/modules-runtime.js:244:21)
at createContainer.jsx (packages/react-meteor-data/createContainer.jsx:1:210)
at fileEvaluate (packages/modules-runtime.js:322:7)
at Module.require (packages/modules-runtime.js:224:14)
at require (packages/modules-runtime.js:244:21)
at react-meteor-data.jsx (packages/react-meteor-data/react-meteor-data.jsx:1:139)
at fileEvaluate (packages/modules-runtime.js:322:7)
at Module.require (packages/modules-runtime.js:224:14)
at require (packages/modules-runtime.js:244:21)
at /home/amardeep/react-16/simple-todo/.meteor/local/build/programs/server/packages/react-meteor-data.js:330:15
at /home/amardeep/react-16/simple-todo/.meteor/local/build/programs/server/packages/react-meteor-data.js:337:3
at /home/amardeep/react-16/simple-todo/.meteor/local/build/programs/server/boot.js:411:36
at Array.forEach (<anonymous>)
Exited with code: 1
Your application is crashing. Waiting for file change.
What could be the possible reason.

Velocity-React Won't Load with Webpack

I am trying to use the following library https://www.npmjs.com/package/velocity-react for animations in my react/webpack project. I am getting a really weird error when I even try and include the file. I do this by, following the documentation, requiring the package at the top of my webpack.config.js file like this:
require('velocity-animate');
require('velocity-animate/velocity.ui');
The error I get is:
/Users/patientplatypus/Documents/arc-app/node_modules/velocity-animate/velocity.js:417
})(window);
^
ReferenceError: window is not defined
at Object.<anonymous> (/Users/patientplatypus/Documents/arc-app/node_modules/velocity-animate/velocity.js:417:4)
at Module._compile (module.js:569:30)
at Module._extensions..js (module.js:580:10)
at Object.require.extensions.(anonymous function) [as .js] (/Users/patientplatypus/Documents/arc-app/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/patientplatypus/Documents/arc-app/webpack.config.js:5:1)
This is very frustrating as it looks like a very neat package, but it won't even load. Does anyone know how to fix this?
You need to include it in your entry point, not the config. What you include in the config is only used for the bundling process, which is in Node not the browser, and window does not exist in Node.
Assuming you have the following entry configuration:
entry: './src/index.js'
In ./src/index.js you import it:
require('velocity-animate');
require('velocity-animate/velocity.ui');
// Or with ES modules
import 'velocity-animate';
import 'velocity-animate/velocity.ui';
If you are using a module, you can do something like this.
import Velocity from 'velocity-animate';
and then use it like this.
let el = document.querySelector("#someId");
Velocity(el, "fadeIn", {duration: 700, stagger: 200, easing: "easeInSine"});
window does not exist in NodeJS, it is related to DOM.

Resources