Skip to content
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

node fs imports problems #8946

Open
einar-hjortdal opened this issue Nov 18, 2022 · 1 comment
Open

node fs imports problems #8946

einar-hjortdal opened this issue Nov 18, 2022 · 1 comment
Labels
Accepting PRs Library definitions Issues or pull requests about core library definitions

Comments

@einar-hjortdal
Copy link

Flow version: 0.193.0

Expected behavior

no errors

Actual behavior

Importing fs/promises causes an error

import {
  readFile,
  writeFile,
  cp,
  mkdir
} from "fs/promises";
/**
 * results in the following error
 * Cannot resolve module `fs/promises`.Flow(cannot-resolve-module)
 */

importing fs.copySync causes an error

import { cpSync  } from "fs";
/**
 * results in the following error
 * Cannot import `cpSync` because there is no `cpSync` export in `fs`. Did you mean `rmSync`?Flow(missing-export)
 */
@einar-hjortdal einar-hjortdal changed the title fs imports problems node fs imports problems Nov 18, 2022
@SamChou19815 SamChou19815 added Library definitions Issues or pull requests about core library definitions and removed bug needs triage labels Nov 19, 2022
@pascalduez
Copy link
Contributor

Hi,
as a temporary (or not so temporary) solution you could install flow-typed node environment. which support fs/promises.
https://flow-typed.github.io/flow-typed/#/env-definitions

For cpSync, better to add it here in core definitions I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepting PRs Library definitions Issues or pull requests about core library definitions
Projects
None yet
Development

No branches or pull requests

3 participants