question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flow 0.32.0 is broken by draft-js@0.9.0

See original GitHub issue
# .flowconfig

[ignore]
.*/__tests__/.*

[include]
./node_modules/react
./node_modules/fbjs/lib
./node_modules/draft-js
./node_modules/immutable

[libs]
./lib
./node_modules/fbjs/flow/lib

[options]
module.use_strict=true
module.name_mapper='.*\(.css\)' -> 'CSSModule'
module.file_ext=.js
module.file_ext=.json
module.file_ext=.css

esproposal.class_static_fields=enable
suppress_type=$FlowIssue
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-8]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\).*\n

[version]
0.32.0

Errors:

node_modules/draft-js/lib/DraftEditorDragHandler.js.flow:36
 36:     var dropRange = document.caretRangeFromPoint(event.x, event.y);
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call of method `caretRangeFromPoint`. Function cannot be called on
 36:     var dropRange = document.caretRangeFromPoint(event.x, event.y);
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `caretRangeFromPoint` of unknown type

node_modules/draft-js/lib/DraftEditorProps.js.flow:48
 48:   ; blockRendererFn?(block: ContentBlock): ?Object
                         ^ Unexpected token (

node_modules/draft-js/lib/DraftEntityType.js.flow:15
 15: import typeof ComposedEntityType from 'ComposedEntityType';
                                           ^^^^^^^^^^^^^^^^^^^^ ComposedEntityType. Required module not found


Found 3 errors

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nktcommented, Sep 22, 2016

@villesau actually flow 0.9.1 fixes this error. You should provide correct configuration:

[ignore]
.*/__tests__/.*
.*/react/node_modules/.*
.*/fbjs/node_modules/.*
.*/node_modules/invariant/.*

[include]
./node_modules/react
./node_modules/fbjs/lib
./node_modules/draft-js
./node_modules/immutable

[libs]
./node_modules/fbjs/flow/lib

[options]
module.system=haste
module.use_strict=true
module.name_mapper='.*\(.css\)' -> 'CSSModule'
module.file_ext=.js
module.file_ext=.json
module.file_ext=.css

esproposal.class_static_fields=enable
suppress_type=$FlowIssue
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-8]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\).*\n

[version]
0.32.0
0reactions
chrisuicommented, Nov 21, 2016

@nkt I’m not sure forcing everyone to use the “haste” module system is the right solution here. For me doing that will result in thousands of new errors and we aren’t really in a position to completely change how our modules are resolved internally to support a few external libraries.

The issue seems to be a little deeper perhaps. Should these libraries using the haste module system for builds not be publishing with the paths updated to be correct in the standard module system? Ie. it actually seems that require calls in .js files are already rewritten to be relative so is the issue just that the same module processing of .js.flow files does not happen?

For the record I am seeing the following errors using draft-js@0.9.1 and flow-bin@0.35.0:

 15: import typeof ComposedEntityType from 'ComposedEntityType';
                                           ^^^^^^^^^^^^^^^^^^^^ ComposedEntityType. Required module not found

node_modules/fbjs/lib/PromiseMap.js.flow:15
 15: var Deferred = require('Deferred');
                    ^^^^^^^^^^^^^^^^^^^ Deferred. Required module not found

node_modules/fbjs/lib/fetchWithRetries.js.flow:16
 16: var ExecutionEnvironment = require('ExecutionEnvironment');
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ExecutionEnvironment. Required module not found

node_modules/fbjs/lib/fetchWithRetries.js.flow:19
 19: var sprintf = require('sprintf');
                   ^^^^^^^^^^^^^^^^^^ sprintf. Required module not found

node_modules/fbjs/lib/fetchWithRetries.js.flow:20
 20: var fetch = require('fetch');
                 ^^^^^^^^^^^^^^^^ fetch. Required module not found


Found 5 errors```
Read more comments on GitHub >

github_iconTop Results From Across the Web

FreeBSD - DistroWatch.com
FreeBSD is a UNIX-like operating system for the i386, amd64, IA-64, arm, MIPS, powerpc, ppc64, PC-98 and UltraSPARC platforms based on U.C. Berkeley's ......
Read more >
Index of /FreeBSD/FreeBSD:14:riscv64/main-main-riscv64 ...
... ap24-mod_cloudflare-2016.10.0.txz · ap24-mod_dnssd-0.6_12.txz · ap24-mod_evasive-1.10.1_2.txz · ap24-mod_fastcgi-2.4.7.1.txz · ap24-mod_fcgid-2.3.9.txz ...
Read more >
Index of Packages Matching 'ark' - PINPDF.COM
Optical Flow counter-measures for the REPLAY-ATTACK database antispoofing.verification.gmm 1.0.2 ... experimental.broken 0.5 ... google-cloud 0.32.0
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found