client.watchQuery cannot be called with fetchPolicy set to "standby" - reactjs

I have run into an issue with #apollo/client. I get this error on v3.4.17 and v3.4.0 which were mentioned in earlier posts. I think the issue is caused by #apollo/react-hooks.
This is my package.json
"#apollo/client": "~3.4.17",
"#apollo/react-hooks": "^4.0.0",
"#apollo/react-ssr": "^4.0.0",
but my package-lock.json looks like this
"#apollo/react-hooks": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/#apollo/react-hooks/-/react-hooks-4.0.0.tgz",
"integrity": "sha512-fCu0cbne3gbUl0QbA8X4L33iuuFVQbC5Jo2MIKRK8CyawR6PoxDpFdFA1kc6033ODZuZZ9Eo4RdeJFlFIIYcLA==",
"requires": {
"#apollo/client": "^3.6.9"
},
"dependencies": {
"#apollo/client": {
"version": "3.6.9",
"resolved": "https://registry.npmjs.org/#apollo/client/-/client-3.6.9.tgz",
"integrity": "sha512-Y1yu8qa2YeaCUBVuw08x8NHenFi0sw2I3KCu7Kw9mDSu86HmmtHJkCAifKVrN2iPgDTW/BbP3EpSV8/EQCcxZA==",
"requires": {
"#graphql-typed-document-node/core": "^3.1.1",
"#wry/context": "^0.6.0",
"#wry/equality": "^0.5.0",
"#wry/trie": "^0.3.0",
"graphql-tag": "^2.12.6",
"hoist-non-react-statics": "^3.3.2",
"optimism": "^0.16.1",
"prop-types": "^15.7.2",
"symbol-observable": "^4.0.0",
"ts-invariant": "^0.10.3",
"tslib": "^2.3.0",
"zen-observable-ts": "^1.2.5"
}
},
}
Any suggestions?

Downgrading the version of "#apollo/react-hooks": "^4.0.0" to "#apollo/react-hooks": "~3.1.3" in the package.json is working for me.
The "#apollo/react-hooks": "^4.0.0" requires the internal dependency of "#apollo/client": "^3.6.9" which is causing the issue. So downgrading the version of #apollo/client won't work when "#apollo/react-hooks": "^4.0.0" is used.

Related

WebStorm - discord.js - "Element is not exported"

For some reason, I and many others have had the issue with WebStorm and Discord.js, specifically it doesn't recognize some of the (re-)exported modules from the package; in this case those from Builders seem to be the ones with the issue:
Yet as suggested for discord.js#14.7.1 I do not have Builders installed:
{
"main": "bot.js",
"type": "module",
"engines": {
"node": "16.x",
"npm": "7.x"
},
"dependencies": {
"#discordjs/rest": "^0.1.0-canary.0",
"canvas": "^2.8.0",
"chart.js": "^3.8.0",
"chartjs-node-canvas": "^4.1.6",
"croner": "^4.2.2",
"discord.js": "^14.7.1",
"dotenv": "^10.0.0",
"fs": "^0.0.1-security",
"fuse.js": "^6.5.3",
"https": "^1.0.0",
"i": "^0.3.7",
"konva": "^8.3.1",
"mongoose": "^6.1.1",
"npm": "^8.13.0",
"path": "^0.12.7",
"sort-by": "^0.0.2",
"string-similarity-js": "^2.1.4",
"url": "^0.11.0"
}
}
Any ideas why WebStorm fails to know about what Discord.js re-exports?
`-- discord.js#14.7.1
`-- #discordjs/builders#1.4.0
You can try installing the discord-api-types library and importing it from there.
import { ButtonStyle } from 'discord-api-types/v10';

Unable to install React-chartjs-2 in React Parcel Project

Very simply by using the following command, I am unable to install React-chartJs-2 module in my React Parcel project:
npm install --save chart.js react-chartjs-2
After the installation when i started my project using (npm start), i getting the following error:
#parcel/core: Failed to resolve 'react-chartjs-2' from './src/pages/dashboard/quiz-detail.js'
My package.json after installation is looks like:
{
"name": "quizcopy",
"version": "1.0.0",
"homepage": ".",
"description": "",
"source": "/src/index.html",
"scripts": {
"start": "parcel",
"build": "parcel build src/index.html"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"#parcel/transformer-sass": "^2.7.0",
"autoprefixer": "^10.4.8",
"buffer": "^6.0.3",
"parcel": "^2.7.0",
"postcss": "^8.4.16",
"process": "^0.11.10",
"sass": "^1.54.9",
"tailwindcss": "^3.1.8"
},
"dependencies": {
"#headlessui/react": "^1.7.0",
"#heroicons/react": "^2.0.10",
"axios": "^0.27.2",
"chart.js": "^4.1.1",
"crypto-js": "^4.1.1",
"dotenv": "^16.0.2",
"js-cookie": "^3.0.1",
"moment": "^2.29.4",
"react": "^18.2.0",
"react-chartjs-2": "^5.1.0",
"react-datetime-picker": "^4.0.1",
"react-dom": "^18.2.0",
"react-export-table-to-excel": "^1.0.6",
"react-google-recaptcha-v3": "^1.10.0",
"react-hot-toast": "^2.4.0",
"react-image-file-resizer": "^0.4.8",
"react-quill": "^2.0.0",
"react-router-dom": "^6.3.0",
"react-transition-group": "^4.4.5",
"read-excel-file": "^5.5.3",
"swr": "^1.3.0"
}
}

Tried To register two Views with the same name RTCVideoView in React Native

I am trying to run my app on Android but I am getting this error I don't know why I am getting this, I don't know what is causing this error in my project
I have tried tried many ways to resolve this issue but Still wasn't able to resolve this issue.
Tried To register two Views with the same name RTCVideoView
My Package.json is
{
"name": "Hello World",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#ptomasroos/react-native-multi-slider": "^1.0.0",
"#react-native-community/async-storage": "^1.6.2",
"#react-native-community/slider": "^2.0.0",
"axios": "^0.19.0",
"connectycube-reactnative": "^1.7.3",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"prop-types": "^15.7.2",
"react": "16.8.6",
"react-native": "0.60.5",
"react-native-autogrow-textinput": "^5.2.0",
"react-native-cache-store": "^1.0.2",
"react-native-calendars": "^1.212.0",
"react-native-deck-swiper": "^1.6.7",
"react-native-image-picker": "^1.1.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-modal-datetime-picker": "^7.5.0",
"react-native-navigation": "^3.0.0",
"react-native-scrollable-tab-view": "^0.10.0",
"react-native-swiper": "^1.5.14",
"react-native-vector-icons": "^6.6.0",
"react-native-view-overflow": "^0.0.4",
"react-native-webrtc": "^1.75.0",
"react-redux": "^7.1.1",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"rn-prompt": "^1.0.4"
},
"devDependencies": {
"#babel/core": "^7.6.0",
"#babel/runtime": "^7.6.0",
"#react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.4.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}
Any Help Would be Appreciated.
All you need is just clean up the cache by the following command
npm cache clean --force
This will resolve your problem most probably
The version of react-native-webrtc you have specified in your package.json is different from the version that connectycube-reactnative depends on. The latest connectycube-reactnative (1.8.0) depends on "react-native-webrtc": "1.69.1".
Double check the dependency of the version you have installed by looking at the node_modules/connectycube-reactnative/package.json and match the version specified in your package.json to the version the connectycube-reactnative requires.
The #arzundo answer is correct
And seems this issue is addressed in latest releases here https://github.com/ConnectyCube/connectycube-reactnative-samples/tree/master/RNVideoChat so you can simply try to pull the latest master

PhpStorm complains that a type is not found but still can open the file defining it

I have an AngularJS project written in TypeScript with PhpStorm.
When compiling with Webpack, I get the following error :
Error:(42, 43) TS2694:Namespace 'angular' has no exported member 'angularFileUpload'.
So there is a problem somewhere. But what bugs me is that PhpStorm is still able to resolve the type and to open the file defining it while complaining that the type cannot be resolved :
Here's an animated gif showing the behavior:
I have the same problem with another library.
In fact, it seems that typings trying to extend the ng namespace are overridden by something later on, and I don't find where.
I have included #types/ng-file-upload and defined the types root in my tsconfig like shown in the animated gif.
Thanks in advance for any advise you could give me.
EDIT :
Here's the content of my package.json file:
{
"name": "...",
"version": "0.0.1",
"description": "...",
"repository": {
...
},
"scripts": {
"gulp": "gulp build --theme=default",
"gulp:prod": "gulp build --theme=default --env=prod",
"gulp:watch": "gulp build --theme=default --watch",
"gulp:watch:prod": "gulp --theme=default --watch --env=prod",
"webpack:native:watch": "webpack --config build/webpack/config/root.config.ts --env.app=native --env.target=julien-localhost --watch",
"webpack:native:prod": "webpack --config build/webpack/config/root.config.ts --env.app=native --env.target=production --env.env=prod",
"webpack:angularjs/admin:watch": "webpack --config build/webpack/config/root.config.ts --env.app=angularjs/admin --env.target=julien-localhost --watch",
"webpack:angularjs/admin:prod": "webpack --config build/webpack/config/root.config.ts --env.app=angularjs/admin --env.target=production --env.env=prod"
},
"dependencies": {
"angular": "^1.6.9",
"angular-animate": "^1.6.9",
"angular-aria": "^1.6.9",
"angular-clipboard": "~1.6.2",
"angular-local-storage": "~0.7.1",
"angular-material": "^1.1.9",
"angular-messages": "^1.6.9",
"angular-moment-picker": "^0.10.2",
"angular-resource": "^1.6.9",
"angular-sanitize": "^1.6.9",
"angular-translate": "~2.17.0",
"angular-ui-notification": "^0.3.6",
"angular-ui-router.statehelper": "~1.3.1",
"bootstrap": "^4.1.3",
"font-awesome": "~4.7.0",
"inversify": "^4.13.0",
"jquery": "^3.3.1",
"jquery-backstretch": "^2.1.16",
"jquery-mousewheel": "^3.1.13",
"jquery-ui": "^1.12.1",
"lodash": "^4.17.10",
"mainloop.js": "^1.0.4",
"malihu-custom-scrollbar-plugin": "^3.1.5",
"moment": "~2.20.1",
"moment-timezone": "^0.5.14",
"ng-file-upload": "~12.2.13",
"parsleyjs": "^2.8.1",
"particles.js": "^2.0.0",
"q": "^1.5.1",
"raven-js": "^3.26.4",
"reflect-metadata": "^0.1.12",
"satellizer": "^0.15.5",
"scrollmonitor": "^1.2.4",
"toastr": "^2.1.4"
},
"devDependencies": {
"#fortawesome/fontawesome-free": "^5.3.1",
"#types/angular": "~1.6.43",
"#types/angular-mocks": "^1.5.11",
"#types/angular-route": "^1.3.4",
"#types/angular-ui-notification": "0.0.4",
"#types/angular-ui-router": "^1.1.40",
"#types/es6-promise": "^3.3.0",
"#types/jquery": "^3.3.6",
"#types/lodash": "^4.14.104",
"#types/modernizr": "^3.5.2",
"#types/ng-file-upload": "~12.2.2",
"#types/node": "^9.6.34",
"#types/q": "^1.5.1",
"#types/reflect-metadata": "^0.1.0",
"#types/source-map": "~0.5.7",
"#types/uglify-js": "^2.6.30",
"#types/webpack-env": "^1.13.6",
"#uirouter/angularjs": "^1.0.15",
"awesome-typescript-loader": "^3.4.1",
"browser-sync": "~2.23.6",
"browser-sync-webpack-plugin": "^2.0.1",
"chalk": "^2.3.1",
"circular-dependency-plugin": "^4.4.0",
"clone": "2.1.2",
"copy-webpack-plugin": "~4.4.1",
"force-case-sensitivity-webpack-plugin": "^0.2.1",
"gulp-angular-embed-templates": "^2.3.0",
"gulp-autoprefixer": "^5.0.0",
"gulp-compass": "^2.1.0",
"gulp-ng-annotate": "^2.1.0",
"gulp-yaml-packages": "~1.0.15",
"html-webpack-plugin": "~2.30.1",
"loader-utils": "^1.1.0",
"ngtemplate-loader": "~2.0.1",
"node-neat": "^2.0.0-beta.0",
"raw-loader": "0.5.1",
"ts-loader": "~3.5.0",
"ts-node": "~5.0.0",
"tslib": "^1.9.0",
"tslint": "~5.9.1",
"tslint-loader": "~3.5.3",
"typescript": "^2.9.2",
"url-loader": "0.6.2",
"webpack": "^3.11.0",
"webpack-merge": "~4.1.1",
"webpack-strip-block": "github:jballant/webpack-strip-block"
}
}
I've found the problem...
My tsconfig.json file contains:
{
"compilerOptions": {
[...]
"types": ["reflect-metadata", "webpack-env"]
}
}
And that's the problem, this limits what typings are included by the compiler to the ones defined in the option :
https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types
That's one more check you need to make if you're in the same situation.
If that can help someone.

undefined is not an object (evaluating 'regeneratorRuntime.mark')- React Native

react-native: 0.49.5
react-native-cli: 2.0.1
node: 8.6.0
Have this error while running my application. It just started to randomly have problems after I started using proptypes in my react native application (do not think that is the problem).
I tried to comment out my store and proptypes to see if that affects anything and I still get the same error.
Note: I tried removing the caret symbol from my package.json, then removing node_modules, then finally installing again with no effect.
UDPATE:
I did some more digging and got the error to say this :
Error: ENOENT: no such file or directory, open '/Users/christian/Desktop/React-Native/roam/node_modules/react-native/node_modules/regenerator-runtime/package.json'
UPDATE:
I removed my node_modules and reinstalled them and now I am getting a similar error but with a different package.
Error: ENOENT: no such file or directory, open '/Users/christian/Desktop/React-Native/roam/node_modules/simple-swizzle/node_modules/is-arrayish/package.json'
package.json:
{
"name": "roam",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-jest": "^23.2.0",
"babel-preset-react-native": "^2.1.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"jest": "^22.4.4",
"jest-enzyme": "^6.0.2",
"jest-react-native": "^18.0.0",
"react-test-renderer": "^16.4.1",
"redux-mock-store": "^1.5.3"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "node node_modules/jest/bin/jest.js"
},
"jest": {
"preset": "react-native",
"transform": {
"^.+\\.jsx?$": "babel-jest"
},
"transformIgnorePatterns": [
"node_modules/(?!react-native|react-navigation)/"
]
},
"dependencies": {
"axios": "^0.18.0",
"babel-preset-env": "^1.6.1",
"expo": "^28.0.0",
"native-base": "^2.6.1",
"prop-types": "^15.6.2",
"react": "^16.2.0",
"react-dom": "^16.4.1",
"react-native": "^0.49.5",
"react-native-elements": "^0.19.1",
"react-native-pages": "^0.7.0",
"react-native-sensitive-info": "^5.1.0",
"react-native-swiper": "^1.5.13",
"react-native-vector-icons": "^4.5.0",
"react-navigation": "^2.9.3",
"react-redux": "^5.0.7",
"react-scripts": "^1.1.4",
"redux": "^3.7.2",
"redux-axios-middleware": "^4.0.0",
"redux-persist": "^5.10.0",
"redux-persist-sensitive-storage": "^1.0.0",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.12.1",
"tcomb-form-native": "^0.6.14",
"util": "*"
}
}
Pack-lock.json (part of it):
"dependencies": {
"#babel/code-frame": {
"version": "7.0.0-beta.51",
"resolved": "https://registry.npmjs.org/#babel/code-frame/-/code-frame-7.0.0-beta.51.tgz",
"integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=",
"dev": true,
"requires": {
"#babel/highlight": "7.0.0-beta.51"
}
},
"#babel/highlight": {
"version": "7.0.0-beta.51",
"resolved": "https://registry.npmjs.org/#babel/highlight/-/highlight-7.0.0-beta.51.tgz",
"integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=",
"dev": true,
"requires": {
"chalk": "^2.0.0",
"esutils": "^2.0.2",
"js-tokens": "^3.0.0"
},
"babel-code-frame": {
"version": "6.0.15",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.0.15.tgz",
"integrity": "sha1-UmlpqYXzFaCBFdxi9IxMDz+af7w=",
"dev": true,
"requires": {
"babel-runtime": "^5.0.0",
"chalk": "^1.1.0",
"esutils": "^2.0.2",
"js-tokens": "^1.0.1",
"line-numbers": "^0.2.0",
"repeating": "^1.1.3"
},
"dependencies": {
"babel-runtime": {
"version": "5.8.38",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-5.8.38.tgz",
"integrity": "sha1-HAsC62MxL18If/IEUIJ7QlydTBk=",
"dev": true,
"requires": {
"core-js": "^1.0.0"
}
},
"babel-core": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz",
"integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=",
"requires": {
"babel-code-frame": "^6.26.0",
"babel-generator": "^6.26.0",
"babel-helpers": "^6.24.1",
"babel-messages": "^6.23.0",
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"babel-template": "^6.26.0",
"babel-traverse": "^6.26.0",
"babel-types": "^6.26.0",
"babylon": "^6.18.0",
"convert-source-map": "^1.5.0",
"debug": "^2.6.8",
"json5": "^0.5.1",
"lodash": "^4.17.4",
"minimatch": "^3.0.4",
"path-is-absolute": "^1.0.1",
"private": "^0.1.7",
"slash": "^1.0.0",
"source-map": "^0.5.6"
},
"dependencies": {
"babel-code-frame": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
"integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
"requires": {
"chalk": "^1.1.3",
"esutils": "^2.0.2",
"js-tokens": "^3.0.2"
}
}
}
},
.babelrc:
{
"presets": [["env", {"modules": false}], "react-native"],
"env": {
"test": {
"presets": [["env", {"modules": false}], "react-native"]
}
}
}
The problem is that one of your library is still importing the
prop-types
from react-native bundle.
You have to correct that.
I was able to get it to work by downgrading React to 16.0.0-beta.5

Resources