Cannot import React components in Node
sullvn opened this issue · comments
Kevin Sullivan commented
There's an error which occurs during import of the SamplesList
component in Node:
/error-example/node_modules/react-native-web/dist/exports/StyleSheet/ReactNativeStyleResolver.js:17
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
^
SyntaxError: Unexpected token {
...
This is probably due to Node's missing support for ES modules and the associated syntax. tastes
uses react-primitives
which in turn uses react-native-web
. Somewhere on that import path the ES modules version of react-native-web
is used instead of the CommonJS version.
Kevin Sullivan commented
The issue occurs here:
react-primitives
is hardcoded to import the ES modules version of react-native-web
for that specific file.