text:
Docker image doesn't work

We have a very simple Dockerfile that just tries to dockerize an already "published" .NETCore app:
FROM microsoft/dotnet:1.1.0-sdk-msbuild-rc4
COPY . .
ENTRYPOINT ["dotnet", "Server.dll"]

you can create the image with:
build.cmd publish

If you then run the container with:
docker run -it --rm fable-suave

It fails with the error:
Error: assembly specified in the dependencies manifest was not found -- package: 'fsharp.core', version: '4.1.0', path: 'lib/netstandard1.6/FSharp.Core.dll'

This is technically correct, but I you do the following it works:
cd deploy
dotnet Server.dll

So something inside the Dockerfile is causing the runtime to look at different place.

Are you publishing the application? Can you share your steps for building the application (server.dll)?

@Petermarcu  as written above build.cmd publish

build.sh publish on Linux/MacOs

Ok, I missed that. Looks like you are running dotnet publish as expected. You also have the PackageReference to the FSharp SDK in your Server project.
You say that it runs from the deploy. That is what I'd expect since that is where you seem to have specified to publish the application to? The contents of your deploy dir are what you should be copying into the image and executing.

Maybe this might help: https://github.com/mastoj/suavecore
A small sample app running suave on core on docker I made.

@mastoj can you see anything that I might be doing wrong?

@petermarcu I copy the full deploy dir into the container. (first I copy the Dockerfile to /deploy and then I run docker build  over there)

@Petermarcu I pushed the docker image to dockerhub at forki/fable-suave if you want to inspect the end result

Summoning @condrong (@shanselman told me you might know)

@forki, can't spot anything obvious. If it helps, here are the commands I run: https://github.com/mastoj/suavecore/blob/master/commands

@mastoj why do you have dotnet run before the docker build? Needed?

Also I'm using rc4 of the dotnet cli with MSBuild. So no project.json

@forki I see that the "script" might be a little bit confusing, that's because it is not a script just a file with commands that I used while playing around.

So it's not needed and it just work's because it's project.json and we now
have a new bug in current rc4?
Am 21.02.2017 09:14 schrieb "Tomas Jansson" notifications@github.com:

@forki https://github.com/forki I see that the "script" might be a
little bit confusing, that's because it is not a script just a file with
commands that I used while playing around.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fable-compiler/fable-suave-scaffold/issues/42#issuecomment-281273765,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNBj8Nf1rDZ_D0tq5Vpjc0a33iP23ks5repzygaJpZM4MGdDb
.

That I don't know. I can't see what the problem is, mainly because I can't build the project on OSX. It shouldn't make a difference if you have project.json, at least that's what I thought.
What I needed to do, when I played with it was this (if I recall correctly):
dotnet build
dotnet publish -c Release

The I used the published bits in the container:
FROM microsoft/dotnet:core
COPY ./bin/Release/netcoreapp1.0/publish /app
WORKDIR /app
EXPOSE 8083
ENTRYPOINT ["dotnet", "suavecore.dll"]

Of course I struggled to get the correct .NET Core  version, tooling etc. to get it to work, but after that it worked like a charm.

but that's exactly what we do here!?
@mastoj why is the build not working for you?

Ok thanks to @mastoj we found out that you need to put it into a subfolder inside the container. Then things work. Weird

authors: Petermarcu forki mastoj

repo: fable-compiler/fable-suave-scaffold

license: unlicense


text:
Use 'package' module for ansible to install packages so make is OS

independent

This has been merged into another branch then into dev.

source: gharchive/pull-request

authors: cscarp hussamnasir

repo: fabric-testbed/MeasurementFramework

license: MIT

license_type: permissive

license_source: github-api


text:
Error when install on Windows 10

I downloaded gofabric8-amd64,exe and run it. I must add gofabric8 location to PATH. Now when i running fabric8 installation stuck.
`C:\Users\vigz54>gofabric8 start --disk-size 40g
minikube.exe is already available on your PATH
kubectl.exe is already available on your PATH
funktion is already available on your PATH
using the executable D:\WORK\home\fabric8\install\minikube.exe
running: D:\WORK\home\fabric8\install\minikube.exe start --vm-driver=hyperv --memory=6144 --cpus=1 --disk-size=40g
Starting local Kubernetes cluster...`
In HyperV log i have Critical Error
 <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">  <System>   <Provider Name="Microsoft-Windows-Hyper-V-Worker" Guid="{51DDFA29-D5C8-4803-BE4B-2ECB715570FE}" />    <EventID>18590</EventID>    <Version>0</Version>    <Level>1</Level>    <Task>0</Task>    <Opcode>0</Opcode>    <Keywords>0x8000000000000000</Keywords>    <TimeCreated SystemTime="2017-02-01T18:57:19.918424700Z" />    <EventRecordID>171</EventRecordID>    <Correlation ActivityID="{A311CB9F-7CBC-0003-3D17-12A3BC7CD201}" />    <Execution ProcessID="1056" ThreadID="1428" />    <Channel>Microsoft-Windows-Hyper-V-Worker-Admin</Channel>    <Computer>NB1319</Computer>    <Security UserID="S-1-5-83-1-3937026448-1242090833-4135447717-1094482573" />    </System>  <UserData>  <VmlEventLog xmlns="http://www.microsoft.com/Windows/Virtualization/Events">   <VmName>minikube</VmName>    <VmId>EAAA4190-CD51-4A08-A5EC-7DF68D7A3C41</VmId>    <VmErrorCode0>0x7fa572e42425</VmErrorCode0>    <VmErrorCode1>0x40000000</VmErrorCode1>    <VmErrorCode2>0x1789f40</VmErrorCode2>    <VmErrorCode3>0x7fa571f3f560</VmErrorCode3>    <VmErrorCode4>0x7fa573085a08</VmErrorCode4>    </VmlEventLog>   </UserData>   </Event>
Can you please help me somehow?

I get the same error on windows 10.

source: gharchive/issue


text:
upgrade jube

upgrade jube

Refer to this link for build results (access rights to CI server needed):
https://fabric8-ci.fusesource.com/job/fabric8-quickstarts-master-pullreq/211/
Test PASSed.

authors: fusesource-ci jstrachan

license_source: bigquery


text:
When trying to move a way node close to an area edge, the node jump

Description
I was trying to align a road close to and area edge when sudenly the node jump to another place dragging the road, try 3 times and the behavior was the same. Took some screenshoots

Version
2.0.0-beta.0
What browser are you seeing the problem on? What version are you running?
Chrome v110.0
The OS you're using
Win10
Steps to reproduce
No response
The browser URL at the time you encountered the bug
https://mapwith.ai/rapid-v2-beta#background=Mapbox&datasets=fbRoads,msBuildings&disable_features=power&map=18.44/-18.18017/-68.70825&overlays=osm-gps
The auto-detected useragent string for your browser (leave blank if you're manually filling this form out)
No response

This behavior seems similar when the area edge highlight as selected when you are adding or editing a line/way adjacent or close to the edge of such area

I'm going through these bugs, trying to repro on a windows machine. This one was filed a few minor versions ago, and I can't seem to reproduce it.  I know we have fixed a bunch of bugs/issues with the border snapping since then though!

Cannot repro.

authors: Bonkles jjiglesiasg

repo: facebook/Rapid

license: ISC


text:
How to use buck2 modes ?

Hello!
I have a small example here (buck2_example) where I try to use buck2 mode during build.
I run it using buck2 run @mode/opt //:main, but I'm getting this error:
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1]    10198 abort      buck2 run @mode/opt //:main

Could you help ?
For more context what I would like to achieve is to be able to invoke buck2 build with different compilers and compiler flags (and probably also different cpu architectures). Could you advice on the best practices for it ? From the official documentation is not quite described or at least I could not found it.
Thanks!

This is just a wild guess, but maybe this line shouldn't be here? https://github.com/MarcoBonino/buck2_example/blob/main/mode/opt#L2 isn't that like, recursively including itself? that would explain the stack overflow.

authors: MarcoBonino steveklabnik


text:
Changes in a .graphql file doesn't recompile automatically

Is this a bug report?
Yes

Did you try recovering your dependencies?

Yes
Which terms did you search for in User Guide?

graphql, import, reload
Environment

Environment Info:

  System:
    OS: macOS 10.14
    CPU: x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
  Binaries:
    Node: 11.1.0 - /usr/local/bin/node
    Yarn: 1.12.1 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 70.0.3538.77
    Firefox: 61.0.1
    Safari: 12.0
  npmPackages:
    react: ^16.6.1 => 16.6.1
    react-dom: ^16.6.1 => 16.6.1
    react-scripts: 2.1.1 => 2.1.1
  npmGlobalPackages:
    create-react-app: Not Found

Steps to Reproduce

Install following deps:

yarn add graphql.macro graphql

Add src/test.graphql:

type Query {
  hello: String
}

Import graphql file:

import { loader } from 'graphql.macro'
const test = loader('./test.graphql')

Add changes to src/test.graphql, eg replace content with:

type Query {
  bye: String
}

Expected Behavior

Bundler recompiles / App reloads
Actual Behavior

Bundler does not recompile / App does not reload
Reproducible Demo

https://codesandbox.io/s/z6yjkp4l4m
Please download from codesandbox since it's only reproducible locally.

Related: https://github.com/facebook/create-react-app/pull/5076, https://github.com/facebook/create-react-app/issues/4893, https://github.com/facebook/create-react-app/pull/3909, https://github.com/facebook/create-react-app/issues/1792

I don't think any of the related issues you listed are related to this specific problem. I think this is more applicable: https://github.com/facebook/create-react-app/issues/5580

Closing as dupe of #5580.

authors: Timer glennreyes iansu

repo: facebook/create-react-app


text:
runtimeChunk is not inlined

Hey, you're using the InlineChunkHtmlPlugin  plugin to inline in the html the runtime generated by webpack, precisely here.
https://github.com/facebook/create-react-app/blob/7e25df150de3c781430979effffa41cec0ba929f/packages/react-scripts/config/webpack.config.js#L547-L551
However this is not working, doing a clean install and build, the runtime chunk is in the files
Is this a bug report?
Yes
Environment
Environment:
OS: macOS 10.14
Node: 10.11.0
Yarn: 1.10.1
npm: 6.4.1
Watchman: Not Found
Packages: (wanted => installed)
react: ^16.6.3 => 16.6.3
react-dom: ^16.6.3 => 16.6.3
react-scripts: 2.1.1 => 2.1.1
Steps to Reproduce

npx create-react-app test
cd test
yarn build

Expected Behavior
There should be no runtime chunk
Actual Behavior

It is actually inlined, if you take a look at the content of build/index.html.

I assume we can see the runtime chunk in the build output because webpack needs to generate this chunk anyway.
The only issue I can see here is the runtime chunk still being committed and written to build folder.
Is it an issue for, @marcofugaro ?

Oh so it's duplicated and it's not actually using the runtime~... file? I think that is misleading

Well. I'd expect InlineChunkHtmlPlugin to remove runtime chunk from being created in the build folder, since it's inlined.
Another thing, that it's totally fine to see the runtime chunk in the build command's console output, because webpack actually creates this chunk, regardless of it's usage.

This file was purposely put in the build/ folder for people who integrate with an existing app (or use CSP) and do not use our index.html file.

authors: Timer marcofugaro miraage


text:
I have to eject and change the webpack configuration to use css modules

Hi, I'm using the latest version of react-scripts and I think It was version 3 or higher, but I couldn't use CSS modules without using eject command and changing the configuration of Webpack file. I didn't know to report this as a bug or Ask a question but I think it's a bug, because based on your docs it should be available with react-scripts@2.0.0 and higher.
Thanks!

Same problem.
Css modules not working after upd react-scripts from 2.1.8 to 3.2.0

Fill out the issue template please, or give us some way to reproduce. I can guarantee that css module support isn't broken in general, so just telling us it's broken doesn't give us any way to fix your particular issue.

authors: Jeerihon Mustafa-Hayati heyimalex


text:
Including submodules in main cra project (not in classical style)

hey,
I'm using react-app rewired witch extends create-react-app.
I have 3 projects(separate repositories):
project-main: using react-app-rewired (typescript version)
project-module1: different react repo (also ts)
project-module2: different react repo (also ts)
project-module1 and project-module2 are linked with yarn to project-main and creates bundle inside of main project with ts compiler.
Current solution:

What I want to achieve:

Basically I need to get rid of part where modules compiles themselves to main project and instead that connect them somehow to main repository compiler in real time. So whenever there will be local code change in folders project-module1 or project-module2, change will be automatically reflected on localhost.
There is also idea connect project-main server to modules servers but I think it would be extremely complicated.
What do you think please?

We don't support react-app-rewired, but IMO if you're separating out packages then you've pretty much opted in to having separate build stages. You could start a separate watch-compilation for each of your project-modules when you start your main development process. It's cludgy, but should work. You could also edit your webpack config to compile ts in node_modules, but it's going to add a lot of complexity and have a lot of hairy edges. Good luck!


text:
save gh-pages as dev dependency

gh-pages is only used at build time so it should probably get marked as a dev dependency when saving to package.json

Thanks for the PR but this is done intentionally. We install everything as regular dependencies. See #6180 (comment) for more information.

Makes sense.  Thanks for the comment

authors: KyleMit iansu


text:
Interpolate variables into template before minification

Fixes https://github.com/facebook/create-react-app/issues/6448
We ran into a problem where a code snippet in our index.html was removed regardless of the NODE_ENV set:
 <script>
 if ("%NODE_ENV%" === "production") {
  // Production only configuration
}
 </script>

The problem was that the interpolation was only registered after the minification already ran. So from the minifier's point of view "%NODE_ENV%" === "production" is always false and the code block can therefore be eliminated.
I tested this out by using a local copy of react-scripts & react-dev-tools and rebuilding our project. I think the only potential bug this change could introduce would be if any steps between the template generation and the emit would actually themselves generate interpolated variables. Those would not be converted by the PR as it is. It may be possible to run the interpolation for both hooks if this turns out to be a problem.

Already fixed in #6449 (but not merge since February) 😅

Thanks for your contribution but I'm going to close this in favour of #6449

Ok, thx. Sorry missed the other PR and the comment linking to it otherwise I would have closed this myself.

authors: GuiHash cedrics iansu


text:
Remove --single-quote from prettier examples

Passing options directly to the cli is not great practice, since default editor integrations won't pick it up and many people are just going to copy paste this snippet. This change removes that customization and prettier will use its very sane defaults.
Closes #7615

There's no original creative work in this PR. Everything is copied verbatim from https://github.com/facebook/create-react-app/pull/7646 including the commit message.

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.
If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

Thanks!

authors: brlewis ianschmitz


text:
Additional prism language (shell-session) is not colored.

🐛 Bug Report
As per Docusaurus docs, I added
prism: {
  additionalLanguages: ['shell-session']
}

under themeConfig in docusaurus.config.js.
I can see that the block of code where I use shell-session is being correctly tokenized, by inspecting it in the browser via "inspect element". However, no colors are applied! I see that in docusaurus, again via inspect element, other language blocks have colors applied directly via inline style tag on the elements of the code that should be colored. This is not happening for code I marked with shell-session. On the other hand, I see on PrismaJs website that in their example, shell-session code is colored by CSS coming from prisma.css, while that is not happening in Docusaurus.
So, it seems to me that shell-session is mostly working due to tokenization working, but for some reason nor inline styling nor styling via prisma.css is happening.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce

Add prism: { additionalLanguages: ['shell-session'] } under themeConfig in docusaurus.config.js.
Create block of code in a markdown doc file, and mark its language as shell-session:

$ ls
some output

Expected behavior
I expected code to be colored, as in example at PrismJs webpage, where $ was yellow and command was red.
Actual Behavior
Code was not colored, it is just grey, as if no known language was specified. But I can see tokenization happening.
Your Environment

Docusaurus version used: 2.0.0-alpha-64
Environment name and version: 80.0.1 (64-bit), Node 12, I am using npm and not yarn
Operating system and version (desktop or mobile): Archlinux

Reproducible Demo
Link to file containing the problematic code block: https://github.com/wasp-lang/web/blob/tutorial/docs/tutorials/todo-app.md .
As seen from the link, repo is https://github.com/wasp-lang/web, and branch is tutorial.
Repo is docusaurus, so just do npm install and npm start and then in the Sidebar, go to Tutorials > Todo App and you will see the code blocks.

Hi,
I've debugged this issue.

The tokens are in the DOM, you should add the shell-session flag to all your codeblocks, many don't have it.
It's not a highlighter problem,  it's just that Docusaurus default syntax highlighting themes don't have anything to highlight properly the  shell-session tokens.
Replacing or importing some additional prism theme classes do solve the problem.
import 'prismjs/themes/prism-tomorrow.css'

$ cd TodoApp
$ wasp start
$ cd ..

If you don't know where to load such theme, you can try the customCSS

@slorber thank you for quick response!
Yes, as I mentioned, tokens are in the DOM, but no style was being applied to them. I had shell-session only on one code block because I wanted to compare the difference between one working and one just being plain once I get it working.
Great, your suggestion solved the problem! I wonder though, how is Docusaurus user supposed to figure this out on their own? Nothing is mentioned about possibly missing CSS when explaining how to add additional languages, and figuring out what to add and where (and that it even should be added) seems to require pretty good understanding of how both docusaurus and prismjs work. Maybe it should be mentioned in the docs, next to the part where addition of additional prism languages is explained?

@Martinsos great to know your problem is solved.

how is Docusaurus user supposed to figure this out on their own?

we are alpha, it's open source, our doc is not perfect and we rely on other open-source projects whose doc is not perfect either .
I had no idea that default prism themes had missing classes for specific languages, I don't know what to do about it right now, and have other more important things to fix and missing docs to write.
If you do not submit a doc PR with possible enhancements about what you have learned, you are also part of the problem 😅  and the reason others will stumble and complain in the future for this missing doc. You can be part of the solution instead, contribute code, doc or money to open-source projects you rely on.

@Martinsos great to know your problem is solved.

how is Docusaurus user supposed to figure this out on their own?

we are alpha, it's open source, our doc is not perfect and we rely on other open-source projects whose doc is not perfect either .
I had no idea that default prism themes had missing classes for specific languages, I don't know what to do about it right now, and have other more important things to fix and missing docs to write.
If you do not submit a doc PR with possible enhancements about what you have learned, you are also part of the problem sweat_smile and the reason others will stumble and complain in the future for this missing doc. You can be part of the solution instead, contribute code, doc or money to open-source projects you rely on.

Hi @slorber, I am maintaining an open source project myself, and I often try to contribute to other projects when I encounter an issue like this, so I very much understand what you are saying -> when I asked how is user supposed to figure this out on their own, I did it because I was interested if I am missing something or if this information is genuinely missing. I did not ask the question in order to nag or to complain, although I get a feeling from your last comment that this is how you perceived it, and I think it would be a wasted opportunity if the conversation continued in that tone. In my l last sentence I asked if it should be mentioned in the docs because I thought I could add it via PR if you say that makes sense.
Since you said even you don't know about this, and this information is actually missing, I will look into creating a PR for this, to add something to documentation.

Sorry for misinterpreting as a complaint then.
I don't know if this should be in the doc or not. We have setup prism, loaded a theme. I think user should rather look at prism doc. We can't duplicate doc of prism, MDX webpack etc in docusaurus doc without cluttering our own doc.
Maybe we could just mention that the default themes may not include highlighting classes for all languages or something. Honestly I don't even know if this is the problem, maybe we did something wrong, or maybe it's a React-prism-renderer issue

Sorry for misinterpreting as a complaint then.
I don't know if this should be in the doc or not. We have setup prism, loaded a theme. I think user should rather look at prism doc. We can't duplicate doc of prism, MDX webpack etc in docusaurus doc without cluttering our own doc.
Maybe we could just mention that the default themes may not include highlighting classes for all languages or something. Honestly I don't even know if this is the problem, maybe we did something wrong, or maybe it's a React-prism-renderer issue
If you want to submit a doc PR please do, we rarely reject them

Got it -> I created PR, it is very simple, so let's see, if that makes sense great, if not maybe it will at least start discussion about the correct solution for this.
PR: https://github.com/facebook/docusaurus/pull/3563 .
Thanks!

Hi, just following up here as I faced this issue today. I believe this issue should remain open:
It is still valid, and it was not addressed in any way: nor through a fix in docusaurus, or through a documentation change as proposed by https://github.com/facebook/docusaurus/pull/3563.
The official docs says:

To add syntax highlighting for any of the other Prism supported languages, define it in an array of additional languages.

That's not true, as this issue states, doing only this is not going to work. More and more people will face the same challenge.
So, I suggest to reopen the issue, until it's properly fixed or documented.

@felipecrs so let's re-open the issue then. However, I don't plan to work on this myself so if you know how to fix it or document it properly, please submit a PR

I think I discovered the root cause of the issue:
Palenight:

GitHub:

So as it seems, the themes (https://github.com/FormidableLabs/prism-react-renderer) are not complete enough. I'll open an issue there.

authors: Martinsos felipecrs slorber

repo: facebook/docusaurus


text:
Docusaurus 2 memory leak with custom remark plugin.

🐛 Bug Report
Recently our build have been exploding with a memory leak (unfortunately I can't pinpoint it exactly, CI seems to still build due to caching, but even the current master will OOM without cache).
Prerequisites

[x] I'm using the latest version of Docusaurus.
[x] I have tried the npm run clear or yarn clear command.
[x] I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.

Description
We are using https://github.com/phryneas/remark-typescript-tools to transpile our TS example code down to JS and typecheck it in the process.
The module exports, like every remark plugin, an attacher "Plugin function" that is called with the options declared in the docusaurus.config.js.
This attacher then creates a TypeScript compiler instance and returns a transformer function that can be called on files to do work.
Now, I'm very sure that previously, attacher was called only once, the compiler instance was reused and transformer was called multiple times, once for each file.
But what currently happens it that attacher is called 51 one times, creating 51 TypeScript compiler instances before transformer is even called for the first time.
With the default memory settings of 4GB, I don't even get to that point, setting it up to 16GB makes it work
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
git clone https://github.com/reduxjs/redux-toolkit
cd redux-toolkit
cd website
npm i
npm run netlify-build

Expected behavior
One instance of the plugin is created and reused.
Actual Behavior

[en] Creating an optimized production build...
ℹ Compiling Client
ℹ Compiling Server
Compiler 0: creating
Compiler 1: creating
Compiler 2: creating
Compiler 3: creating
Compiler 4: creating
Compiler 5: creating
Compiler 6: creating
Compiler 7: creating
Compiler 8: creating
Compiler 9: creating
Compiler 10: creating
Compiler 11: creating
Compiler 12: creating
Compiler 13: creating
Compiler 14: creating
Compiler 15: creating
Compiler 16: creating
Compiler 17: creating
Compiler 18: creating
Compiler 19: creating
Compiler 20: creating
Compiler 21: creating
Compiler 22: creating
Compiler 23: creating
Compiler 24: creating
Compiler 25: creating
Compiler 26: creating
Compiler 27: creating
Compiler 28: creating
Compiler 29: creating
Compiler 30: creating
Compiler 31: creating
Compiler 32: creating
Compiler 33: creating
Compiler 34: creating
Compiler 35: creating
Compiler 36: creating
Compiler 37: creating
Compiler 38: creating
Compiler 39: creating
Compiler 40: creating
Compiler 41: creating
Compiler 42: creating
Compiler 43: creating
Compiler 44: creating
Compiler 45: creating
Compiler 46: creating
Compiler 47: creating
Compiler 48: creating
Compiler 49: creating
Compiler 50: creating
Compiler 51: creating
Compiler 22: running /home/weber/tmp/redux-starter-kit/docs/rtk-query/usage/pagination.mdx
Compiler 22: finished
Compiler 38: running /home/weber/tmp/redux-starter-kit/docs/rtk-query/usage/code-splitting.mdx
Compiler 38: finished
Compiler 41: running /home/weber/tmp/redux-starter-kit/docs/rtk-query/api/setupListeners.mdx
Compiler 41: finished
Compiler 7: running /home/weber/tmp/redux-starter-kit/docs/api/otherExports.mdx
Compiler 7: finished
Compiler 14: running /home/weber/tmp/redux-starter-kit/docs/api/createSelector.mdx
Compiler 14: finished
Compiler 27: running /home/weber/tmp/redux-starter-kit/docs/rtk-query/usage/customizing-create-api.mdx
Compiler 27: finished
Compiler 36: running /home/weber/tmp/redux-starter-kit/docs/rtk-query/usage/code-generation.mdx
Compiler 47: running /home/weber/tmp/redux-starter-kit/docs/rtk-query/api/created-api/redux-integration.mdx
Compiler 47: finished
Compiler 0: running /home/weber/tmp/redux-starter-kit/docs/usage/usage-guide.md
Compiler 1: running /home/weber/tmp/redux-starter-kit/docs/usage/usage-with-typescript.md
Compiler 3: running /home/weber/tmp/redux-starter-kit/docs/api/createAsyncThunk.mdx
Compiler 3: finished
Compiler 4: running /home/weber/tmp/redux-starter-kit/docs/api/serializabilityMiddleware.mdx
Compiler 4: finished
Compiler 5: running /home/weber/tmp/redux-starter-kit/docs/api/createSlice.mdx
Compiler 5: finished
Compiler 6: running /home/weber/tmp/redux-starter-kit/docs/api/configureStore.mdx
Compiler 6: finished
Compiler 8: running /home/weber/tmp/redux-starter-kit/docs/api/createAction.mdx
Compiler 8: finished
Compiler 9: running /home/weber/tmp/redux-starter-kit/docs/api/immutabilityMiddleware.mdx

and a stack trace for how attacher is called:
at Function.attacher (/home/weber/tmp/redux-starter-kit/website/node_modules/remark-typescript-tools/dist/remark-typescript-tools.cjs.development.js:325:27)
    at freeze (/home/weber/tmp/redux-starter-kit/node_modules/unified/index.js:128:28)
    at Function.process (/home/weber/tmp/redux-starter-kit/node_modules/unified/index.js:362:5)
    at compile (/home/weber/tmp/redux-starter-kit/node_modules/@mdx-js/mdx/index.js:126:37)
    at Object.docusaurusMdxLoader (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/mdx-loader/src/index.js:67:20)
    at LOADER_EXECUTION (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:132:14)
    at runSyncOrAsync (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:133:4)
    at iterateNormalLoaders (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:250:2)
    at iterateNormalLoaders (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:239:10)
    at /home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:254:3
    at context.callback (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at Object.markdownLoader (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/plugin-content-docs/lib/markdown/index.js:14:25)
    at LOADER_EXECUTION (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:132:14)
    at runSyncOrAsync (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:133:4)
    at iterateNormalLoaders (/home/weber/tmp/redux-starter-kit/node_modules/@docusaurus/core/node_modules/loader-runner/lib/LoaderRunner.js:250:2)
Error: initializing cache
    at cached (/home/weber/tmp/redux-starter-kit/website/node_modules/remark-typescript-tools/dist/remark-typescript-tools.cjs.development.js:285:11)

At this point and with this knowledge, of course I can try to rewrite the plugin, but I am very sure that similar "memory-explosive" problems will occur with other remark plugins as well.

Having found out what Docusaurus does (spawning the plugin once for each file), I could now optimize for that case and memory consumption went back to 2.5GB. This is what I did on plugin side.
Of course this does not resolve this behaviour on Docusaurus' side and I guess a lot of Docusaurus' high memory consumption would go down by resolving it, but I thought I would share my success :)


text:
Google Crawler Breadcrumb Structured Data Error

Have you read the Contributing Guidelines on issues?

[X] I have read the Contributing Guidelines on issues.

Prerequisites

[X] I'm using the latest version of Docusaurus.
[X] I have tried the npm run clear or yarn clear command.
[X] I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
[ ] I have tried creating a repro with https://new.docusaurus.io.
[X] I have read the console error message carefully (if applicable).

Description
This issue occurs only when Google Search Crawls your Docusaurus site.  It will warn you that breadcrumb structured data was detected but it is invalid with the following error:
Invalid URL in field "id" (in "itemListElement.item")
Perhaps this is a change to Googles Own Search Criteria, I am not 100% clear but I did not see this error until I upgraded my Docusaurus to the latest version last week.
Reproducible demo
No response
Steps to reproduce

Use Docusaurus Docs with Nested Content
Submit to Google
Wait for Google to finish crawling and do a validation check.
Observe validation errors reported by Google Search Console

Expected behavior
Breadcrumb Structured Data to be valid.
Actual behavior
Breadcrumb Structured Data is invalid.
Your environment

Public source code: https://github.com/cloudlayerio/docs
Public site URL: https://docs.cloudlayer.io
Docusaurus version used: 2.0.0-beta.18
Environment name and version (e.g. Chrome 89, Node.js 16.4): n/a
Operating system and version (e.g. Ubuntu 20.04.2 LTS): n/a

Self-service

[ ] I'd be willing to fix this bug myself.

Duplicate of #7303

This has been fixed by #7304 and released in beta.19

authors: Josh-Cena elucidsoft


text:
flow requires SU privileges to run

Running flow in my system 1 as a standard user (not root) results in:
$ flow server
[2016-04-20 15:34:07] Initializing Server (This might take some time)
[2016-04-20 15:34:07] executable=/home/miguelg/src/flow.git/bin/flow
[2016-04-20 15:34:07] version=0.23.0
[2016-04-20 15:34:07] Parsing
Fatal error: exception Sys_error("/tmp/systemd-private-79b6d2d6e0584633abc26fe5d79a666d-tor.service-TVwX1C: Permission denied")
Exception: Sys_error("Broken pipe")
Potential backtrace:

and flow stays in a never-ending loop outputting:
Exception: Sys_error("Broken pipe")
Potential backtrace:

But if I run flow as root:
# flow server
[2016-04-20 15:34:30] Initializing Server (This might take some time)
[2016-04-20 15:34:30] executable=/home/miguelg/src/flow.git/bin/flow
[2016-04-20 15:34:30] version=0.23.0
[2016-04-20 15:34:30] Parsing
[2016-04-20 15:34:33] Building package heap
[2016-04-20 15:34:34] Running local inference
[2016-04-20 15:34:38] Re-resolving directly dependent files
[2016-04-20 15:34:38] Calculating dependencies
[2016-04-20 15:34:38] Merging
[2016-04-20 15:34:39] Done
[2016-04-20 15:34:39] Server is READY
[2016-04-20 15:34:39] Took 8.701974 seconds to initialize.

1 System:
```
Linux 4.2.0-35-generic
Ubuntu 15.10
Flow 0.23.0
```

Hmm... Are you running the server from within a directory with a .flowconfig?
(If so, can you also provide that just to rule out any uncertainty)

i can repro. looking into it!

repro:
mkdir testdir
cd testdir
flow init
mkdir foo
sudo chown root foo
sudo chmod 700 foo
flow check

result:
Fatal error: exception Sys_error(".../foo: Permission denied")

authors: jeffmo miguel-guedes mroch

repo: facebook/flow


text:
Dynamic imports in generator don't work

I have this code (to lazy-load a module in my redux-saga):
function myGenerator() {
  const { lookup: lookupMIMEType } = yield call(() => import("mime-types"));
}

Problem
See here: https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVUCuA7AxgFwEs5twBzAU2wAoBKMAb1TDFxIGd9GwAHAQwBO7CmAC+YALxgAnoQowAJqz4wY1OpIB8YQgFsecAfmoAiTAJgnatANzoWAivnPZeg4XdFA
The flow try tool seems to crash silently. On my CLI I get the following error:
$ flow --max-warnings 0
Launching Flow server for /Users/leoselig/nexenio/web
Spawned flow server (pid=50359)
Logs will go to /private/tmp/flow/zSUserszSleoseligzSnexeniozSweb.log
Monitor logs will go to /private/tmp/flow/zSUserszSleoseligzSnexeniozSweb.monitor_log
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/app-files/src/js/routing/index.js:0:1

Internal error: uncaught exception:
Context.Require_not_found("\"/Users/some/path/to/file.js\":
(90, 63) to (90, 75)")
Raised at file "map.ml", line 130, characters 10-25
Called from file
"hack/utils/collections/myMap.ml", line 15, characters 13-23

Found 1 error

Expected
Get the same result as with the workaround here

It no longer crashes


text:
Explicit type specification for component rendering <MyComponent />

Proposal
Now there is no possibility to explicitly specify the generic type for the component.
This syntax can solve the problem:
<MyComponent<T> />;

I can be rea
Use case
// @flow
import React from 'react';

class MyComponent<T> extends React.Component<{| +item: T |}>{  }

<MyComponent<number> item={1} />; // work good
<MyComponent<string> item={1} />; // error

Yeah agreed this could be useful, I've run into it before (although for my use-case I've now just started using Hooks, which are easier to type).  In the end I worked around it like this:
class ConcreteComponent extends MyComponent<number> {}

<ConcreteComponent item={1} />

...although that solution only works for class components, not functional components.
Supported in TypeScript since 2.9: https://github.com/Microsoft/TypeScript/pull/22415

I have implemented parsing side, would submit PR soon

This is something that's been on my list for a while, but I was never sure I would get to it. Thanks for looking into this, @goodmind! I will review as soon as I can.

@goodmind will your PR also add support for something like:
type LinkProps<T> = {a: T};
declare var AAA<T>: React$StatelessFunctionalComponent<{children: (props: LinkProps<T>) => void}>;

try flow
see: https://github.com/flow-typed/flow-typed/pull/3281/files#diff-f6fab52153e41297b233b7e3a1975af6R86

@villesau, no, why?

Would be useful with type definitions.

Why not generic function?

How would you express this:
type LinkProps<T> = {a: T};
declare var AAA<T>: React$StatelessFunctionalComponent<{children: (props: LinkProps<T>) => void}>;

declare function AAA<T>(props: {children: (props: LinkProps<T>) => void}): React$Node

Any movement on this? This is an awesome feature in Typescript.

The PR just got merged, so I guess we'll see!

authors: asazernik clayne11 goodmind jamesisaac jbrown215 retyui villesau


text:
React uncontrolled form input - null value

I'm testing an uncontrolled form input via Jest. My onChange handler receives the new values but when I confirm the value it's Null.
Form Input
var MyForm = React.createClass({
  handleChange: function(event) {
    console.log('handleChange:'+event.target.value);
  },
  render: function () {
    return (
       <form>
          <input onChange={this.handleChange} type="text" className="input-email" />
      </form>
    );
  }
});

Test
it('Should update value', function() {
    var instance = TestUtils.renderIntoDocument(<MyForm />);
    var el = TestUtils.findRenderedDOMComponentWithClass(instance, 'input-email');
    var node = el.getDOMNode();

    TestUtils.Simulate.change(node,{target: {value: "new value"}});
    expect(node.value).toEqual('new value');
  });

Result
Using Jest CLI v0.2.2
 FAIL  __tests__/myform-uncontrolled-test.js (1.241s)
handleChange:new value
● Update Uncontrolled Form Value › it Should update value
  - Expected: null toEqual: 'new value'
        at Spec.<anonymous> (/var/www/form-input/__tests__/myform-uncontrolled-test.js:16:24)
        at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
 PASS  __tests__/myform-test.js (1.241s)
handleChange:new value
1 test failed, 1 test passed (2 total)
Run time: 1.839s
npm ERR! Test failed.  See above for more details.

I have the sample code here - https://github.com/timarney/react-formtest

The value is null because you haven't set a value on the input. Simulate change just triggers change handlers with the provided arguments. It doesn't set the value of the input to 'new value'. If this was jquery, simulate() is like $(input).trigger('change') and not like $(input).val('new value').  This doesn't seem like a bug in jest but a misunderstanding of how Simulate works.

I see what your saying...
In React if I have just
<input type="text" className="input-email" />
The docs say:

An  that does not supply a value (or sets it to null) is an uncontrolled component. In an uncontrolled , the value of the rendered element will reflect the user's input.

So via Jest how do I reflect the users input for an *uncontrolled * form?

I'm not sure why you are trying to test core react functionality but you can set the input value however you want. Either via value or defaultValue props on the input, or by setting it directly on the input DOM element. You may want to bring your questions to the React repo since your questions seem to be related to the react specific test utils which are not part of Jest (a bit confusing)

Sorry for the confusion... I was trying to test my login form to see if it would alert... if a bad value was received. Running the test showed the input always had a null value after the simulated change.
I tried handling the onChange myself and the alert would show and the test would pass.
After consulting the docs further it seemed like the first test should have worked.... it works in the browser.
So... if it works in React via the browser, I wasn't sure if the issue was a Jest thing, a React thing or just a misunderstanding of the docs on my end.

@timarney any updates on that? I also have getting null

See - https://github.com/facebook/react/issues/3151#issuecomment-74943529

authors: AngeIII jquense timarney

repo: facebook/jest


text:
Tests pass locally but "fail" on CI (i.e. test suites fail but all individual tests pass)

Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Tests are passing locally for me but don't pass on Travis. The output on Travis says 9/9 tests passed, but only 5/7 test suites passed, and it's rerunning a few tests twice.
I cleared the package and repository cache and reran the build but the error still persists.
Here's the output from the latest Travis build:
$ npm test
> install-peerdeps@1.4.0 test /home/travis/build/nathanhleung/install-peerdeps
> jest --verbose
 FAIL  lib/src/helpers.test.js
  ● Test suite failed to run
    Cannot find module './helpers' from 'helpers.test.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
      at Object.<anonymous> (lib/src/helpers.test.js:3:16)
 FAIL  lib/src/installPeerDeps.test.js
  ● Test suite failed to run
    Cannot find module './installPeerDeps' from 'installPeerDeps.test.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
      at Object.<anonymous> (lib/src/installPeerDeps.test.js:3:24)
 PASS  src/helpers.test.js
  ✓ parses package strings correctly (56ms)
 PASS  lib/helpers.test.js
  ✓ parses package strings correctly (22ms)
 PASS  lib/installPeerDeps.test.js
  ✓ gets the package data from the registry correctly (298ms)
 PASS  src/installPeerDeps.test.js
  ✓ gets the package data from the registry correctly (200ms)
 PASS  src/cli.test.js (7.03s)
  ✓ errors when more than one package is provided (945ms)
  ✓ errors when no arguments are provided (518ms)
  ✓ errors when the package name argument is formatted incorrectly (535ms)
  ✓ only installs peerDependencies when `--only-peers` is specified (577ms)
  ✓ adds an explicit `--no-save` when using `--silent` with NPM (545ms)
Test Suites: 2 failed, 5 passed, 7 total
Tests:       9 passed, 9 total
Snapshots:   0 total
Time:        11.904s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.
Repository here: nathanhleung/install-peerdeps - you should be good to go with yarn install and yarn test.
Travis builds here: nathanhleung/install-peerdeps on Travis CI.
What is the expected behavior?
Here's the output on my local machine with Node v4 and Node v6:
yarn test v1.0.1
$ jest --verbose "--no-cache"
 PASS  src\helpers.test.js
  √ parses package strings correctly (17ms)

 PASS  src\installPeerDeps.test.js
  √ gets the package data from the registry correctly (254ms)

 PASS  src\cli.test.js (11.901s)
  √ errors when more than one package is provided (2366ms)
  √ errors when no arguments are provided (2157ms)
  √ errors when the package name argument is formatted incorrectly (1973ms)
  √ only installs peerDependencies when `--only-peers` is specified (1605ms)
  √ adds an explicit `--no-save` when using `--silent` with NPM (1718ms)

Test Suites: 3 passed, 3 total
Tests:       7 passed, 7 total
Snapshots:   0 total
Time:        14.329s
Ran all test suites.
Done in 15.71s.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
Jest 21.2.1
Node 4.8.6, 6.12.0 and 7.2.1 on my local machine (Windows 10)
Node 4.8.6 ("4"), 6.12.0 ("6"), and 9.1.0 ("node") on Travis (Ubuntu 14.04)
yarn 1.0.1
This has been bothering me for about week now and I appreciate anything that could help point me in the right direction. Jest has so far been a pleasure to work with and I'd really love to figure this one out!

It probably means your require strings don't match the file names. Is the file called helpers.test.js or Helpers.test.js.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions. Thank you :)

Thank you, I'll do that next time. Sorry for bothering you.

Hey @nathanhleung, I'm new to Jest and encountering the same behavior. Tests all pass locally, but I get module resolution issues on CircleCI. Were you able to solve this issue? If so, any insights you can share? Appreciate any help!

you're probably on mac/linux with case insensitive FSes. You might want https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md#casesensitive.
That said, I wanna improve the error message here, and look for casing errors for a module not found, together with missing/wrong file extension (#4025)

I had the same problem with jest.mock('package');
For some reasons in CI the jest.mock doesn't work. I had to change the path of the package to make it work. It's tricky cause you need to try multiple combination before making it work in CI, although all of them work locally.
PS: I'm using Azure Devops

authors: ChrisALarson SimenB cpojer hamzahamidi nathanhleung


text:
globalTeardown leaves tests hanging

Do you want to request a feature or report a bug?
Report a Bug
When I run jest using the command npm run jest, and in my package.json the jest command is this: "jest": "jest", the tests are run and pass but it never ends. See the image below to see the state it's left in. I'd expect the runner to end. This is preventing me from using this test as a pre-push hook in git.

I know this happening because I am using the globalSetup and globalTeardown options. Those files look as follows:
globalSetup:
const app = require('../src/app');
module.exports = () => {
  const server = app.listen(2323);
  global.server = server;
}

globalTeardown:
module.exports = () => {
  global.server.close()
}

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
jest: 22.4.2
npm: 3.10.10
macOS: 10.13.3

Can you prepare a repro of that so we can download and investigate?

I fixed this by adding the --forceExit option

It's not a fix. It means there's a memory leak either in your tests or your code. Try to run jest --detectLeaks.

Soooo all of my tests failed

@mbenjamin618 your tests are probably using global.server, which isn't being dereferenced in your teardown so the environment is leaking
Can you push a repo so I can take a look?

No reproduction pushed, but happy to reopen if one comes

authors: SimenB mbenjamin618 rickhanlonii thymikee


text:
Error: Cannot find module 'ErrorUtils' from 'env.js'

React-native v0.24, jest v12
 FAIL  src/foo-test.js
Runtime Error
Error: Cannot find module 'ErrorUtils' from 'env.js'
    at Runtime._resolveNodeModule (/foo-project/node_modules/jest-cli/src/Runtime/Runtime.js:451:11)
    at Object.<anonymous> (/foo-project/node_modules/react-native/jestSupport/env.js:22:28)

The error is from this line:
jest.setMock('ErrorUtils', require('ErrorUtils'));

Introduced by this commit in react-native: https://github.com/facebook/react-native/commit/b84ad2ab0da26d8285986a4519b2d824f520ce65

1+

Can you try adding this: https://github.com/fbsamples/f8app/blob/master/package.json#L51-L60 to your Jest config? That should work.
The docs in react-native about Jest testing are unfortunately entirely outdated and no one is bothering to update them :(

Closing as duplicate of #921.

vvvnvnvbnbnbfcgvbvbnvjbjhbkjbhhhhhhhhhhhhhk

Is this a yubikey?

yyyyyyyyu

which one version suites for that?
@cpojer

authors: ColCh IPENGR KathiresanRamkumar95 cpojer dbuarque


text:
Convert eslint configuration file to .eslintrc.js

Summary
The project currently uses deprecated eslint configuration and just like every other major projects, jest can use updated eslint configuration too.

The PR improves a deprecated configuration and prepares the project for benefits to come in future and avoid related risks.
The lint task after the change is functional and intact.
pr375903 at L-156107356 in ~/Development/labs/jest (improve-eslint-configuration)
$ npm run lint

> @ lint /Users/pr375903/Development/labs/jest
> yarn run lint-prettier --silent && eslint . --cache && yarn run lint-docs --silent

yarn run v0.22.0
$ node scripts/prettier.js lint
$ cd /Users/pr375903/Development/labs/jest
$ /Users/pr375903/Development/labs/jest/node_modules/.bin/prettier --bracket-spacing=false,--print-width=80,--single-quote=true,--trailing-comma=all,--l,integration_tests/__tests__/auto-clear-mocks-test.js,integration_tests/__tests__/auto-reset-mocks-test.js,integration_tests/__tests__/babel-plugin-jest-hoist-test.js,integration_tests/__tests__/compare-dom-nodes-test.js,integration_tests/__tests__/config-test.js,integration_tests/__tests__/console-test.js,integration_tests/__tests__/coverage_report-test.js,integration_tests/__tests__/coverage-remapping-test.js,integration_tests/__tests__/coverage-threshold-test.js,integration_tests/__tests__/custom-reporters-test.js,integration_tests/__tests__/debug-test.js,integration_tests/__tests__/empty_suite_error-test.js,integration_tests/__tests__/env-test.js,integration_tests/__tests__/failures-test.js,integration_tests/__tests__/global-test.js,integration_tests/__tests__/globals-test.js,integration_tests/__tests__/jasmine_async-test.js,integration_tests/__tests__/jest.config.js-test.js,integration_tests/__tests__/json_reporter-test.js,integration_tests/__tests__/json-test.js...

$ cd /Users/pr375903/Development/labs/jest
$ /Users/pr375903/Development/labs/jest/node_modules/.bin/prettier --bracket-spacing=false,--print-width=80,--single-quote=true,--trailing-comma=es5,--l,examples/async/__mocks__/request.js,examples/async/__tests__/user-test.js,examples/async/request.js,examples/async/user.js,examples/enzyme/__tests__/CheckboxWithLabel-test.js,examples/enzyme/CheckboxWithLabel.js,examples/getting_started/sum.js,examples/getting_started/sum.test.js,examples/jquery/__tests__/displayUser-test.js,examples/jquery/__tests__/fetchCurrentUser-test.js,examples/jquery/displayUser.js,examples/jquery/fetchCurrentUser.js,examples/manual_mocks/__mocks__/fs.js,examples/manual_mocks/__tests__/FileSummarizer-test.js,examples/manual_mocks/FileSummarizer.js,examples/react-native/__tests__/Intro-test.js,examples/react-native/index.android.js,examples/react-native/index.ios.js,examples/react-native/Intro.js,examples/react/__tests__/CheckboxWithLabel-test.js...

✨  Done in 9.46s.
yarn run v0.22.0
$ eslint --config ./.eslintrc-docs.json --no-ignore --ext md ./docs/*.md
✨  Done in 0.49s.

Codecov Report

Merging #3669 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3669   +/-   ##
=======================================
  Coverage   62.57%   62.57%
=======================================
  Files         181      181
  Lines        6694     6694
  Branches        6        6
=======================================
  Hits         4189     4189
  Misses       2502     2502
  Partials        3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f2107f...da17db2. Read the comment docs.

Thank you!

Thanks @cpojer 🙂

authors: codecov-io cpojer crashuniverse


text:
Is/Will String.includes be supported?

http://devdocs.io/javascript/global_objects/string/includes

How does this relate to jstransform? Do you expect String.includes to be transformed? I'd recommend to polyfill it instead.

repo: facebook/jstransform


text:
Bug: convertFromMarkdownString() does not convert return lines (\n)

Lexical version: latest version
I'm using $convertToMarkdownString to get the content of my editable content:
editorState.read(() => {
  const markdown = $convertToMarkdownString(TRANSFORMERS);
  ...
});

The result is good and I have this kind of result, stored in a backend database:

"**info** 1\n\n*info* 2\n\ninfo 3\n\n1. info 4"
Then when I read the value from the database and tried to use the convertFromMarkdownString method, all the return values (\n) are omitted:
editor.update(() => {
    $convertFromMarkdownString(value, TRANSFORMERS);
  }
});

By the way, I notice that list is also affected, since \n are not correctly saved:

$convertToMarkdownString converts to "1. item 1\n2. item 2\n3. item 3\n4. item 4"
$convertFromMarkdownString is not converting back correctly the list (because \n are omitted):

I guess I need to create a TRANSFORMER ?
Or is it something already developed and in progress ?
Do you have any idea on how to resolve this issue ?
If a TRANSFORMER is needed, do you have any guidance ? advices ? tutorials ?

bug fixed, I had a bug with an HTMLInputElement (replace with an HTMLTextAreaElement)

repo: facebook/lexical


text:
[RFC][0.10] Rework generateNodesFromDOM API

I will try to get around to writing up a more extensive explanation later. The main purposes of this are twofold:

Improve the out-of-the-box experience for HTML serialization and deserialization in the storage format use-case (as opposed to the transfer/copy-paste use case).

One of the big issues here is that we can't support interpretation of html attributes like background-color or text-align in the core without creating a poor user experience during HTML copy+paste. The idea here is to transfer those semantics via custom attributes on HTML, so we can support HTML-as-a-storage-format (deserializing into an editor with the same configuration) at a higher fidelity while preserving control during copy/paste.

Amend the public API to be less cluttered and provide a path for additional options

Ultimately, I'd like to experiment with bringing more of this logic out of the core library and into the editor configuration, possible with some defaults in the rich-text or utils modules. import/exportDOM makes sense on the nodes, but it is honestly pretty clunky to have to do that for just a simple use case like supporting a text style.

Could you add an example of new API usage?

LGTM

Amend the public API to be less cluttered and provide a path for additional options

I'm unsure how this PR addresses this but I like the long-term vision of moving all the conversion functionality outside of the Core

I was thinking because now generateNodesFromDOM will take an options object instead of just continuously adding more arguments.

I like the concept here.
QQ, why is convertDOMElementLexicalData() only for element nodes?

Good question - it's because all ElementNode subclasses don't need this logic, so I couldn't very easily put it in the base class. Instead, I put it in a util to avoid repetition. Will look closer at this when I have time to take another pass.

Could you add an example of new API usage?

yes, I will

@acywatson Mind resolving the merge conflicts?

I'm eagerly awaiting this feature.
Will it be in the 0.13.0 release?

Closing this PR due to staleness! If there are new updates, please reopen the PR.

authors: acywatson etrepum fantactuka n1215 thegreatercurve


text:
base64 does not work tried several npm packages

https://github.com/dankogai/js-base64
https://github.com/feross/buffer
Always get error for Buffer npm package.

Same in RN 0.41.0, but cannot reproduce in 0.29.0

Related to #4968

Just run:
npm install --save buffer
Thx to @PaulBGD

Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with Canny! Check out its new home: https://react-native.canny.io/feature-requests/p/base64-does-not-work-tried-several-npm-packages

authors: alekseykarpenko anupkale1984 hramos

repo: facebook/react-native


text:
Catching JS-exceptions in Native

Is there a way to catch the exceptions that might occur in JavaScript (like in render() or various event-handlers) in native?
My application logic is native, only the view/presentation logic is handled by react-native, so I need to pass on the error somehow. At the moment my production build just crashes when an exception occurs.
Congratulations to this awesome project!

Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why.


text:
Can not auto run packager service when use cocoapods to build a RN project.

According to ducumention
react-native init AwesomeProject
cd AwesomeProject
react-native run-ios

create a project and run successfully.
I find that the launchPackager.command will auto run when build the project.
But when I use cocoapods to integrate react-native,it will crash when run this app.How can i configure my Xcode to make npm startauto run.

solve this problem,i change the path of the run script.


text:
set borderRadius topLeft and bottomLeft affects the view displaying

<View style={{marginTop: 100,width: Width, height: 35, borderTopLeftRadius: 18, borderBottomLeftRadius: 18, backgroundColor: 'red'}}/>

This situation is not correct， and it displays mess on 6sPlus:

and  it is like this when resize to 100%:

But if I set the height to even number Or add the radius to the other corner, it displays correct.

RN: 0.33
ios simulator 6p, 10.3

Hello! Please follow the issue template when you file an issue. Additionally, no support is provided for very old versions of React Native -- 0.33 is just about 12 versions behind, which is nearly a year.

authors: Creemli brentvatne


text:
'react-native log-ios' doesn't work with xcode 9.1

react-native log-ios doesn't work with xcode 9.1
I get this error:

NOTE:  Most system logs have moved to a new logging system.  See log(1) for more information.

Has anyone been able to find a workaround for this?
Environment:
OS:  macOS High Sierra 10.13.1
Node:  7.9.0
Yarn:  0.27.5
npm:  4.2.0
Watchman:  4.7.0
Xcode:  Xcode 9.1 Build version 9B55
Android Studio:  Not Found
Packages: (wanted => installed)
react: ^16.0.0 => 16.0.0
react-native: ^0.50.0-rc.1 => 0.50.0-rc.1

@wootwoot1234 I'm having the same issue. Any findings on your side since 8 days ago?


text:
algorithm file not found in 'Yoga-internal.h'

algorithm file not found in 'Yoga-internal.h'

[x] I have followed the documentation

Environment
OS: macOS High Sierra 10.13.3
Node: 9.8.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed)
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: ^0.54.2 => 0.54.2
Steps to Reproduce (from {ROOT})

cd js
yarn add react-native
cd ../
pod install :  dependecies installed √
try to build my app but it doesn't work X

I've also tried to remove "Pods" directory and "Podfile.lock" and retry
Podfile
I have "node_modules" on a directory called {ROOT}/js
....
pod 'React', :path => 'js/node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
'RCTText',
'RCTNetwork',
'RCTWebSocket',
]
pod "yoga", :path => "js/node_modules/react-native/ReactCommon/yoga"
pod 'DoubleConversion', :podspec => 'js/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => 'js/node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'Folly', :podspec => 'js/node_modules/react-native/third-party-podspecs/Folly.podspec'
...

This is fixed, to my understanding, by https://github.com/facebook/react-native/pull/18492 which is now on master. You'll need to build from source or wait for a new release to be cut.

@hramos I'd like to install pod specs automatically. I think it's not a good idea editing code manually to keep my CLI pipeline clean.

That’s fine. Fix will be part of the next release, you only need to build from source if you can’t wait until then.

authors: hramos matteocollina


text:
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.asda.android/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit

Hi,
I am having the exception mentioned in the title.
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.asda.android/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit.
I tried every suggestion I could find on the internet, especially the ones pointed here. https://github.com/facebook/react-native/issues/18599#issuecomment-520712334
When the app works on a physical device with android 10, it is not accepted by play store. When I try the suggestions that make it work on the playstore, they don't work on the device.
I tried every version of react-native from 0.57.1 to 0.59.1
What should I do to make it be accepted on the device, and work on my phone when I download it.

It looks like this might be caused by a third-party module.

authors: dulmandakh kgoedert


text:
use_frameworks! fails on 0.63.0-rc.1

Description
I'm trying to upgrade RN to 0.63.0-rc.1, where I have use_frameworks! in Podfile, and got error below
Pods-RN063' target has transitive dependencies that include statically linked binaries:

React Native version:
System:
OS: macOS 10.15.5
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 410.96 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.4.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2, 29.0.3
System Images: android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
npmGlobalPackages:
react-native: Not Found
Steps To Reproduce

Create a new project using RN 0.63.0-rc.1 or npx react-native init RN063 --version  0.63.0-rc.1
Find Podfile and add use_frameworks!, then run pod install and it'll fail.

Expected Results
pod instal would run successfully, then compile and run the project.
Snack, code example, screenshot, or link to a repository:
Podfile example
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'RN063' do
  use_frameworks!
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'RN063Tests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'RN063-tvOS' do
  # Pods for RN063-tvOS

  target 'RN063-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

it seems caused by OpenSSL-Universal

It’s not just OpenSSL-Universal, but from what I recall also, at least, CocoaLibEvent.
While this is indeed something I would like to see differently, it’s a known thing and hence the comment in the Podfile:
  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.

If anything, this issue should be filed in the flipper repo, but there probably already is one.

authors: alloy dulmandakh


text:
RN 0.62.2 on ios TextInput secureTextEntry option does not show last character typed on

Description
Typing in a TextInput with the secureTextEntry option hides all characters, even the last character typed for ios. This was reproduced in 0.62.2. It works fine in 0.61.5 and would briefly show the last character typed. Running this on Android with RN 0.62.2 briefly shows the last character typed.
React Native version:
System:
OS: macOS 10.15.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 623.41 MB / 32.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.4.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 28, 29
Build Tools: 28.0.3, 29.0.3
System Images: android-28 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_252 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
react-native: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.

Select the text input and begin typing
All characters are obscured immediately as typed

Expected Results
It is expected that the last character typed is briefly revealed before being obscured. This used to work in RN 0.61.5 but has changed in RN 0.62.2 for ios only.
code example
import React from 'react';
import {TextInput, Text, SafeAreaView} from 'react-native';

const App = () => {
  const [value, setValue] = React.useState('');
  return (
    <SafeAreaView>
      <Text>Password</Text>
      <TextInput
        value={value}
        onChangeText={text => setValue(text)}
        secureTextEntry
      />
      <Text>Password 2</Text>
      <TextInput secureTextEntry />
    </SafeAreaView>
  );
};

export default App;

Expo v38 has correct version of RN to reproduce this error: https://snack.expo.io/W!SW9YerN

Any updates on this issue?

+1 having the same issue. Same RN version. Android works but iOS does not (both on SIM and actual device using TestFlight).

Having same issue on iOS with same RN version 0.62.2

Any updates on this? Does anyone know if upading expo/react-native fixes this?

Up 👆🏼

I wanted to ask if you still experience this issue.
I'm planning to do 1-2 months of opensource and I'm preparing a list of tasks.
I have been contributing to facebook/react-native for 4 years and I specialize on the Text/TextInput components.
Thanks a lot

@fabriziobertoglio1987 I don't have an ios device anymore to try this out but the Expo snack no longer reproduces the problem. So I think this was fixed at some point through some other change.

authors: Commoddity anoraxdev fabriziobertoglio1987 fempyrean innergap paulvilledieu timtmok


text:
[0.65.0] npx react-native init AwesomeProject ERESOLVE dependency failure

Description
When I try to create a fresh/new project as for documentation with following command:
npx react-native init AwesomeProject
the execution fail with following error(s):
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: AwesomeProject@0.0.1
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-test-renderer@17.0.1
npm ERR! node_modules/react-test-renderer
npm ERR!   dev react-test-renderer@"17.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See ~/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2021-08-19T12_56_21_294Z-debug.log
(node:12013) UnhandledPromiseRejectionWarning: Error: Command failed: npm install --save --save-exact react@17.0.2
    at makeError (~/rnprojects/AwesomeProject/node_modules/execa/index.js:174:9)
    at ~/rnprojects/AlefProject/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async generateProject (~/rnprojects/AlefProject/node_modules/@react-native-community/cli/build/commands/init/initCompat.js:122:3)
    at async Object.initCompat (~/rnprojects/AlefProject/node_modules/@react-native-community/cli/build/commands/init/initCompat.js:105:3)

React Native version:
System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    Memory: 577.77 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.17.5 - /usr/local/opt/node@14/bin/node
    Yarn: Not Found
    npm: 6.14.14 - /usr/local/opt/node@14/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - ~/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 30
      Build Tools: 30.0.3
      System Images: android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7199119
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_282 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.65.0 => 0.65.0
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Note I tried also with:
Node: 16.7.0 - /usr/local/opt/node@16/bin/node
npm: 7.20.3 - /usr/local/opt/node@16/bin/npm

obtaining same (error) result
Steps To Reproduce

open terminal
digit npx react-native init AwesomeProject and press enter
(obtain the above error)

Expected Results
It should be possible to successfully create a fresh react native app-project (from default template) in the expected (sub)directory AwesomeProject.

@fondakogb This has been fixed in 0.65.1 which was released a few hours ago.

Set react-test-renderer to 17.0.2 in the template

@DoctorJohn I confirm that this dependency-issue has been fixed in 0.65.1.
Thank you all for your great work

authors: DoctorJohn fondakogb


text:
IOS: Include of non-modular header inside framework module 'yoga.YGNode':

Description
In my react native IOS app (android works fine) when I run npx react-native run ios I get a few errors related to react-native-image-picker and Yoga (whatever that is).
Screenshot of errors in xcode where I can see more detailed errors info:
https://i.imgur.com/KzzYR1a.png
In cli error looks like this (less detailed):
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'react-native-video' from project 'Pods')
	CompileC /Users/gabriel/Library/Developer/Xcode/DerivedData/wooapp-ecvnzpvdhxltnxeoglpliezckkzc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-image-picker.build/Objects-normal/x86_64/ImagePickerManager.o /Users/gabriel/Desktop/proyectos/wiii/node_modules/react-native-image-picker/ios/ImagePickerManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-image-picker' from project 'Pods')

I'm not using M1 chip or Rosetta. My xcode version is 13.
"react-native": "0.68.5",
"react-native-image-picker": "^5.1.0",

My pod file:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
#$RNFirebaseAsStaticFramework = true
platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'wooapp' do
  config = use_native_modules!
  #use_frameworks!
  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true
  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'wooappTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  #use_flipper!()

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        target.build_settings(config.name)['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
      end
    end
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

Thanks in advance
React Native Version
0.68.5
Output of npx react-native info
System:
OS: macOS 12.6.3
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 455.92 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.9.0 - /usr/local/bin/node
Yarn: Not Found
npm: 8.19.1 - /usr/local/bin/npm
Watchman: 2022.09.05.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.5 => 0.68.5
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
npx pod-install ios
npx react-native run-ios -- --reset-cache
Error shows up in cli
Building in xcode I get same error but with more info (error is related to Yoga modules)
Snack, code example, screenshot, or link to a repository
Can't share reproducible example

In my react native IOS app (android works fine) when I run npx react-native run ios I get a few errors related to react-native-image-picker and Yoga (whatever that is).

Hi @Gabotron-ES
Thanks for reporting this issue.
It seems like this issue is actually unrelated to React Native core. Please open this issue against this other repository:
https://github.com/react-native-image-picker/react-native-image-picker/issues
I'll be closing this but feel free to reopen if the other repo points back to us as a issue in the core of React Native.

authors: Gabotron-ES cortinico


text:
Error setting property 'secureTextEntry' of RCTTextField

I'm not much of a mobile / front-end developer, so please bare with me.
We have a register / login form with a tab selector between the two forms. Previously both forms were just the login / password, but now we're requiring first and last name. This resulted in the failure Error setting property 'secureTextEntry' of RCTTextField for the password TextInput field(s) and the application crashes when switching tabs.
If one of the password inputs is not set as secure then it works properly. If a single TextInput field is added, then it works. It seems that if the tabs differ by an even number of fields then the crash occurs, but if odd then it works properly. I'm guessing there is some off-by-one error somewhere in the framework.
The workaround was to have an empty TextInput that is not rendered.

{
title: 'Passwords',
render: function() {
return (
<TextInput
defaultValue="iloveturtles"
password={true}
style={[styles.singleLine, {color: 'green'}]}
/>
);
}
},

Is this still happening?

@facebook-github-bot no-reply

authors: ben-manes browniefed christopherdro wv1124


text:
The type of SectionBase.data as ReadonlyArray

Description
I don't know if this is really a bug, but I couldn't find a better template for it.
I'm using a TypeScript library that returns data as a list, but the data type extends only the Iterable type, causing a type error because the data type in SectionList should be a ReadonlyArray.
https://github.com/facebook/react-native/blob/6c8dfc89566d27c36f9ca3828bcf3a63dfcb6942/packages/react-native/Libraries/Lists/SectionList.d.ts#L32
Shouldn't this type be ArrayLike just like it is in the data of FlatList?
https://github.com/facebook/react-native/blob/6c8dfc89566d27c36f9ca3828bcf3a63dfcb6942/packages/react-native/Libraries/Lists/FlatList.d.ts#L47
Steps to reproduce
Attempting to use an ArrayLike in a SectionList.
React Native Version
0.73.2
Affected Platforms
Other (please specify)
Output of npx react-native info
System:
  OS: macOS 13.6
  CPU: (8) arm64 Apple M1
  Memory: 50.94 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.2
    path: ~/.nvm/versions/node/v18.18.2/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.nvm/versions/node/v18.18.2/bin/yarn
  npm:
    version: 9.8.1
    path: ~/.nvm/versions/node/v18.18.2/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/gregory/.rvm/gems/ruby-2.7.6/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.10121639
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.15
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/gregory/.rvm/rubies/ruby-2.7.6/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.2
    wanted: 0.73.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs
No overload matches this call.
  Overload 1 of 2, '(props: SectionListProps<Task, { data: ResultsType<Task>; }> | Readonly<SectionListProps<Task, { data: ResultsType<Task>; }>>): SectionList<...>', gave the following error.
    Type 'ResultsType<Task>' is not assignable to type 'readonly Task[] & ResultsType<Task>'.
      Type 'Results<Task>' is not assignable to type 'readonly Task[]'.
        The types of '[Symbol.unscopables].length' are incompatible between these types.
          Type 'number' is not assignable to type 'boolean | undefined'.
  Overload 2 of 2, '(props: SectionListProps<Task, { data: ResultsType<Task>; }>, context: any): SectionList<Task, { data: ResultsType<Task>; }>', gave the following error.
    Type 'ResultsType<Task>' is not assignable to type 'readonly Task[] & ResultsType<Task>'.ts(2769)

Reproducer
https://github.com/GregoryEsberci/rn-flat-list-data-type
Screenshots and Videos
No response

I looked at the code for this one.
VirtualizedList originally also accepted ReadonlyArray but we ended up making it more permissive after we found real usage which relied on it accepting more than just arrays. This was also slightly breaking because the list provided callbacks with the same time, which needed to be made more generic.
VirtualizedSectionList is typed to accept arrays, and these arrays are also given to callbacks, to render the sections.
The internals could be changed to operate on ArrayLike instead, but this would be breaking to existing functions which accept sections to render, and assume a full array is present.
TLDR: the current typings are correct, but arguably a larger (but breaking) change could be made to make the data more permissive.
If your data is small enough to copy the Iterable to an array, that would be the easiest way around this.

authors: GregoryEsberci NickGerleman