Error using mismatched PostCSS dependencies - npm

Anyone know how to get composes working in gatsby css modules.
I've tried using.
.dog {
composes: dog from "styles/common.scss"
}
I get this error.
Your current PostCSS version is 5.2.18, but postcss-nesting uses
6.0.23. Perhaps this is the source of the error below.
I've tried installing postcss-nesting
But that doesn't seem to stop the above error in gatsby

Your current PostCSS version is 5.2.18, but postcss-nesting uses 6.0.23. Perhaps this is the source of the error you're running into.
Try upgrading PostCSS to at least 6.0

Related

compile errors after upgrading to latest CRA

I just updated to latest create-react-app (web pack 5). And am now getting the following errors (I'm just showing the first 2 errors here). Any help explaining what this error means and how to fix it would be greatly appreciated. I don't think the problem is with react-pdf because I created a new create-react-app project that uses that package and there's no problem.
{
Compiled with problems:X
ERROR in ./node_modules/react-pdf/node_modules/#babel/runtime/helpers/esm/inherits.js 1:0-46
Module not found: Error: Can't resolve './setPrototypeOf' in '/Users/bob/dev/workbox-web/node_modules/react-pdf/node_modules/#babel/runtime/helpers/esm'
Did you mean 'setPrototypeOf.js'?
BREAKING CHANGE: The request './setPrototypeOf' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
ERROR in ./node_modules/react-pdf/node_modules/#babel/runtime/helpers/esm/objectWithoutProperties.js 1:0-74
Module not found: Error: Can't resolve './objectWithoutPropertiesLoose' in '/Users/bob/dev/workbox-web/node_modules/react-pdf/node_modules/#babel/runtime/helpers/esm'
Did you mean 'objectWithoutPropertiesLoose.js'?
BREAKING CHANGE: The request './objectWithoutPropertiesLoose' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
}
Somehow I was accessing a wrong version of babel after CRA upgrade to 5. Deleting node_modules and re-installing was not enough. I needed to delete node_modules and yarn.lock and then yarn install - and then all was ok.

Visual studio code error :-Failed to start flow Error: Wrong version of Flow. The config specifies version ^0.92.0 but this is version 0.95.1

Hello I am a beginner in React-native and below is my flowconfig file's version and I get an error with this version
[version]
^0.92.0
Is there a way to fix this error, I was trying to run debug mode in visual code for running react-native projects and to print console.log.
So far I am unsuccessful.
PS:- beginner in react-native
Change [version] in the .flowconfig to match the installed version, ^0.95.1
1. Check that the following tags match
package.json
"devDependencies": {
"flow-bin": "0.130.0"
}
.flowconfig
[version]
^0.130.0
2. Clean & Reinstall
If they match, this error can occur when your node_modules are out of sync with the version of flow-bin in your package.json. This can occur if you've changed branches recently or have have an older version in your node modules.
Try removing and reinstalling like this:
rm -rf node_modules/ && npm i
Instead of changing the flow version make it a ranged version. For example something like >=0.50.0 or simply remove the version altogether. You can read about that more in the flowconfig docs
I find that changing the flow version every time you face this problem to be a bad approach especially if you work with a team and each team member has a different version installed and they would commit their version into the .flowconfig file

How to install gulp via NPM?

Following this tutorial to set up app. It seems pretty normal and standard compared to all of the other tutorials that I have found. However, when tried and complete the 1.2.3 step Create a gulpfile.js at the root of the project: I am getting this error
error syntax error near unexpected token `}'
This is the command used in terminal.
var gulp = require('gulp');
Basically all want to do is download gulp so, can run sass with my css in atom. Any help?
You're right. The code wasn't for the terminal. I needed to create the file separately. I misread the tutorial. Thanks for the help!

Protractor 5.1.1 selenium-webdriver version inconsitency

I've recently upgraded to Protractor 5.1.1 and am facing some issues when setting cookies via browser.manage().addCookie()
The API has changed between versions 2 and 3 of Selenium-webdriver to expect an object rather than the previous 2..6 arguments. When I make the changes to my code to use the object, the typescript compiler complains saying that it expects 2..6 arguments.
old api:
browser.manage().addCookie('cookieName', 'cookieVal');
new api:
browser.manage().addCookie({name:'cookieName', value: 'cookieVal'});
I think this is because the #types/selenium-webdriver in the package.json of protractor v5.1.1 is pointing at version 2.53.39. The version of the actual selenium-webdriver the same package.json is referencing is 3.0.1.
Should this be the same value? Is anyone else experiencing problems with this?
Yup, this is happening because the type definitions was not written at the time.
workaround
Here is the workaround for now:
(browser.manage() as any).addCookie({name:'cookieName', value: 'cookieVal'});
We are setting browser.manage returned options object to any. Then we can give it the addCookie method.
OR
upgrade definitions
you could upgrade your #types/selenium-webdriver type definitions to version 3.
I'm having the same problem! I do know that the #types/selenium-driver is now updated to version 3.0.0.
I haven't had luck with this, but you could try installing it directly (i.e. npm install --save-dev #types/selenium-webdriver) and adding it to your list of types in your tsconfig.json file (i.e. types: [ "selenium-webdriver" ].

React-Native: Requiring unknown module "react/lib/ReactPropTypesSecret"

I am trying to compile the master branch of the react-native repo to submit a PR. I am following the docs https://facebook.github.io/react-native/docs/android-building-from-source.html
But doing exactly what do docs says, I get the following error on android:
Requiring unknown module "react/lib/ReactPropTypesSecret
Also running on ios gives similar kind of error:
Unable to resolve module react/lib/ReactPropTypesSecret from /Users/aakash/Projects/TestingPR/node_modules/react-native/Libraries/Utilities/deprecatedPropType.js: Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/react/lib/ReactPropTypesSecret
This issue occurs when an ReactNative-App based on RN 0.28 or older is upgraded to RN 0.30 or newer without to update also the "react"-package to at least 15.3.0.
Have you tried this?
If this will not solve your issue, you should provide your package.json.