-
-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flow Errors #411
Comments
More full errors:
|
CSSStyleRule is declared here. Why can't flow find it? It should be actually part of flow cssom |
Not following, so is this local error or are you saying flow needs to update to fix? |
Both, right now it should work because I have a type for CSSStyleRule. |
Same problem. Flow doesn't include node_modules/jss/flow-typed automatically. If i include this into .flowconfig, all works fine: [libs]
node_modules/jss/flow-typed Your local declaration of CSSStyleRule is workaround. May be make pr into https://github.com/facebook/flow/blob/master/lib/cssom.js ? Or write some installation notes in readme for it? |
I was planing to make it into cssom … but if you got time I am happy if someone else does it! |
flow is an awesome project to contribute to! |
so @natew are u interested to bring those defs to flow? |
cc @lttb |
I had a similar error, which has now disappeared. Maybe a new version of Flow fixed it? |
thats possible |
@natew I am closing this one, please reopen if the issue is still there. |
Hello! I'm running into these errors still. Versions: Console output:
Adding these lines to my
|
Just to chime in I am also getting errors. Using latest create-react-app with styled-components. I am assuming it is styled-components that has jss as a dependency but I am not sure (I am not using it directly). flow-bin v 0.54.1
|
I get a slightly different set of errors from @zachwolf and @garytokyo
jss: 8.1.0 Newly created app via the create-react-app starter kit. I worked around the CSSStyleRule errors by adding the following to my .flowconfig
|
yes, it has been fixed in jss 9 |
@kof - Just upgraded to jss 9 and I'm still getting the same errors - namely a bunch of #these are mitigated by adding node_modules/jss/flow-typed into [libs] in .flowconfig
Error: node_modules/material-ui/node_modules/jss/lib/renderers/DomRenderer.js.flow:15
15: function getStyle(rule: HTMLElement|CSSStyleRule, prop: string): string {
^^^^^^^^^^^^ identifier `CSSStyleRule`. Could not resolve name Error: node_modules/material-ui/node_modules/jss/lib/renderers/DomRenderer.js.flow:128
128: return node
^^^^ Node. This type is incompatible with the expected return type of
123: function findCommentNode(text: string): Comment|null {
^^^^^^^^^^^^ union: Comment | null
Member 1:
123: function findCommentNode(text: string): Comment|null {
^^^^^^^ Comment
Error:
128: return node
^^^^ Node. This type is incompatible with
123: function findCommentNode(text: string): Comment|null {
^^^^^^^ Comment
Member 2:
123: function findCommentNode(text: string): Comment|null {
^^^^ null
Error:
128: return node
^^^^ Node. This type is incompatible with
123: function findCommentNode(text: string): Comment|null {
^^^^ null Error: node_modules/material-ui/node_modules/jss/lib/utils/findRenderer.js.flow:15
15: return useVirtual ? VirtualRenderer : DomRenderer
^^^^^^^^^^^^^^^ VirtualRenderer. This type is incompatible with the expected return type of
12: export default function findRenderer(options: JssOptions = {}): Class<Renderer> {
^^^^^^^^ Renderer
Property `constructor` is incompatible:
7: export default class VirtualRenderer {
^^^^^^^^^^^^^^^ default constructor. This type is incompatible with. See: node_modules/material-ui/node_modules/jss/lib/renderers/VirtualRenderer.js.flow:7
25: constructor(sheet?: StyleSheet): Renderer;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. See: node_modules/material-ui/node_modules/jss/lib/types.js.flow:25
This parameter is incompatible:
7: export default class VirtualRenderer {
^^^^^^^^^^^^^^^ undefined. This type is incompatible with. See: node_modules/material-ui/node_modules/jss/lib/renderers/VirtualRenderer.js.flow:7
25: constructor(sheet?: StyleSheet): Renderer;
^^^^^^^^ Renderer. See: node_modules/material-ui/node_modules/jss/lib/types.js.flow:25
Property `attach` is incompatible:
25: constructor(sheet?: StyleSheet): Renderer;
^^^^^^^^ property `attach` of Renderer. Property not found in possibly undefined value. See: node_modules/material-ui/node_modules/jss/lib/types.js.flow:25
7: export default class VirtualRenderer {
^^^^^^^^^^^^^^^ undefined. See: node_modules/material-ui/node_modules/jss/lib/renderers/VirtualRenderer.js.flow:7 |
I just checked, can't reproduce, please verify if you are REALLY using JSS 9 in that case by looking into directory. |
material-ui is not using JSS 9 yet. |
Apologies - turns out I was looking at the package.json/node_modules for one project while running flow status against another. No issues encountered. Thanks! |
Same error with last version of JSS and Flow:
|
it can't find CSSStyleRule in https://github.com/cssinjs/jss/blob/master/flow-typed |
If I include jss/flow-typed in .flowconfig, I got:
|
@ohardy could you provide the flow version please? |
|
@ohardy I have the same issue, it is because the newest version of flow does not support the static modifier anymore apparently. If im not mistaken, this is since |
Same issue for me, new repo, using material ui, importing JSS to create the options for JssProvider import { create } from 'jss';
import { MuiThemeProvider, createMuiTheme, jssPreset, createGenerateClassName } from 'material-ui/styles';
const jss = create(jssPreset()); Added node_modules/jss/flow-typed to my flow config and then I get the same error as @ohardy
versions: "jss": "^9.8.0",
"material-ui": "next",
"flow-bin": "^0.66.0", |
Upgraded JSS to flow v0.68.0, JSS v.9.8.1 is published. |
👍 confirmed working for me cheers |
Getting this with flow:
in types.js.flow
The text was updated successfully, but these errors were encountered: