Directory import is not supported resolving ES modules when trying import { map } from 'rxjs/operators';

Viewed 4146

I'm getting the following error when trying to import the map operator.
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import is not supported resolving ES modules imported from

import { map } from 'rxjs/operators';

Node version: v14.15.0

1 Answers

It seems that ES6 modules are not yet supported
To be able to import the map module I needed to use internals as follow:

import { map } from 'rxjs/internal/operators/map.js';

Hope this might help someone.

Related