Error when running third party library: Unable to resolve module 'module://react-dom/unstable-native-dependencies.js'

Hi!

I’m maintaining a react-native package using TypeScript. I lately refactored it to use named import for react.

from:
import * as React from 'react';

to:
import React, { ReactNode } from 'react';

in my tsconfig.json I’m using

"module": "commonjs", "moduleResolution": "node", "esModuleInterop": true, "allowSyntheticDefaultImports": true,

even though when trying to running the library it gives me `Unable to resolve module ‘module://react-dom/unstable-native-dependencies.js’``

When using a version of the package with star import instead, it just works.

I also try on react-native init/expo init and both versions work fine. It looks to be only on snack. Any idea what I’m missing?

You can try it by yourself here https://snack.expo.io/@jeremdsgn/vengeful-chocolates
“react-native-modalize”: “1.3.7-rc.26” it the “broken version” with import React, { ReactNode } from 'react';
and “react-native-modalize”: “1.3.7-rc.27” the previous version with import * as React from 'react';

Thanks in advance,

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.