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

Cannot resolve module node:fs #9028

Open
mrtnzlml opened this issue Apr 28, 2023 · 1 comment
Open

Cannot resolve module node:fs #9028

mrtnzlml opened this issue Apr 28, 2023 · 1 comment
Labels
Library definitions Issues or pull requests about core library definitions

Comments

@mrtnzlml
Copy link
Contributor

Missing/Incorrect APIs

Flow doesn't support node: imports such as:

import fs from 'node:fs';

Currently, the following error is thrown:

Cannot resolve module node:fs. [cannot-resolve-module]

The only supported syntax is the original version without node: prefix:

import fs from 'fs';

This affects all Node.js imports, not just fs.

Relevant documentation

See: https://nodejs.org/api/esm.html#node-imports

@mrtnzlml mrtnzlml added the Library definitions Issues or pull requests about core library definitions label Apr 28, 2023
@pascalduez
Copy link
Contributor

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

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

No branches or pull requests

2 participants