question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

4.0.0-rc.6 - Module parse failed: Unexpected token

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Explain what you did

  • Created a new Expo project using: npx create-expo-app
  • Added the RNEUI base and themed packages: npm install @rneui/base @rneui/themed
  • started the project in web mode: npm run web

for the following errors:

Uncaught Error: Module parse failed: Unexpected token (7:58)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { defaultSpacing } from './theme';
| import { lightColors } from './colors';
> const isClassComponent = (Component) => Boolean(Component?.prototype?.isReactComponent);
| const combineByStyles = (propName = '') => {
|     if (propName.endsWith('Style') || propName.endsWith('style')) {
    at ./node_modules/@rneui/themed/dist/config/withTheme.js (theme.js:2:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./node_modules/@rneui/themed/dist/config/index.js (index.js:1:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./node_modules/@rneui/themed/dist/AirbnbRating/index.js (index.js:1:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./node_modules/@rneui/themed/dist/index.js (index.js:1:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./App.js (App.js:1:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./node_modules/expo/AppEntry.js (AppEntry.js:1:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at 1 (index.js:29:1)
    at __webpack_require__ (bootstrap:789:1)
    at bootstrap:856:1
    at bootstrap:856:1
./node_modules/@rneui/themed/dist/config/withTheme.js @ theme.js:2
__webpack_require__ @ bootstrap:789
fn @ bootstrap:100
./node_modules/@rneui/themed/dist/config/index.js @ index.js:1
__webpack_require__ @ bootstrap:789
fn @ bootstrap:100
./node_modules/@rneui/themed/dist/AirbnbRating/index.js @ index.js:1
__webpack_require__ @ bootstrap:789
fn @ bootstrap:100
./node_modules/@rneui/themed/dist/index.js @ index.js:1
__webpack_require__ @ bootstrap:789
fn @ bootstrap:100
./App.js @ App.js:1
__webpack_require__ @ bootstrap:789
fn @ bootstrap:100
./node_modules/expo/AppEntry.js @ AppEntry.js:1
__webpack_require__ @ bootstrap:789
fn @ bootstrap:100
1 @ index.js:29
__webpack_require__ @ bootstrap:789
(anonymous) @ bootstrap:856
(anonymous) @ bootstrap:856
VM630:2 Uncaught ReferenceError: process is not defined
    at 4043 (<anonymous>:2:13168)
    at r (<anonymous>:2:306599)
    at 8048 (<anonymous>:2:9496)
    at r (<anonymous>:2:306599)
    at 8641 (<anonymous>:2:1379)
    at r (<anonymous>:2:306599)
    at <anonymous>:2:315627
    at <anonymous>:2:324225
    at <anonymous>:2:324229
    at e.onload (index.js:1:1)
4043 @ VM630:2
r @ VM630:2
8048 @ VM630:2
r @ VM630:2
8641 @ VM630:2
r @ VM630:2
(anonymous) @ VM630:2
(anonymous) @ VM630:2
(anonymous) @ VM630:2
e.onload @ index.js:1
be @ index.js:1
de @ index.js:1
handleErrors @ webpackHotDevClient.js:169
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
load (async)
be @ index.js:1
de @ index.js:1
handleErrors @ webpackHotDevClient.js:169
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Card/Card.Title.js 10:25
Module parse failed: Unexpected token (10:25)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|         {
|             fontSize: normalize(14),
>             color: theme?.colors?.grey1,
|             ...Platform.select({
|                 android: {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Icon/Icon.js 10:37
Module parse failed: Unexpected token (10:37)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     ? Pressable
|     : View, solid = false, brand = false, theme = defaultTheme, pressableProps, ...rest }) => {
>     const color = colorProp || theme?.colors?.black;
|     const reverseColor = reverseColorProp || theme?.colors?.white;
|     const IconComponent = getIconType(type);
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/SearchBar/SearchBar.js 11:13
Module parse failed: Unexpected token (11:13)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| };
| export class SearchBar extends React.Component {
>     searchBar;
|     static defaultProps = {
|         platform: 'default',
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Input/Input.js 11:23
Module parse failed: Unexpected token (11:23)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| });
| export class Input extends React.Component {
>     static displayName = 'Input';
|     input;
|     shakeAnimationValue = new Animated.Value(0);
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Card/Card.FeaturedSubtitle.js 11:25
Module parse failed: Unexpected token (11:25)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|             fontSize: normalize(13),
|             marginBottom: 8,
>             color: theme?.colors?.white,
|             ...Platform.select({
|                 android: {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Card/Card.FeaturedTitle.js 11:25
Module parse failed: Unexpected token (11:25)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|             fontSize: normalize(18),
|             marginBottom: 8,
>             color: theme?.colors?.white,
|             ...Platform.select({
|                 android: {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Overlay/Overlay.js 11:49
Module parse failed: Unexpected token (11:49)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                 fullScreen && styles.fullscreen,
|                 {
>                     backgroundColor: Color(theme?.colors?.white)
|                         .lighten(10)
|                         .rgb()
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Tab/Tab.Item.js 11:63
Module parse failed: Unexpected token (11:63)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|             styles.titleStyle,
|             {
>                 color: variant === 'primary' ? 'white' : theme?.colors?.secondary,
|                 paddingVertical: !rest.icon ? 8 : 2,
|             },
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Text/Text.js 14:29
Module parse failed: Unexpected token (14:29)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                     },
|                 }),
>                 color: theme?.colors?.black,
|             },
|             style,
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Header/Header.js 15:122
Module parse failed: Unexpected token (15:122)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     });
|     return (React.createElement(React.Fragment, null,
>         React.createElement(StatusBar, { barStyle: barStyle, translucent: true, backgroundColor: backgroundColor || theme?.colors?.primary, ...statusBarProps }),
|         React.createElement(ViewComponent, { testID: "headerContainer", ...rest, style: StyleSheet.flatten([
|                 {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Tooltip/Tooltip.js 17:32
Module parse failed: Unexpected token (17:32)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     });
|     const getElementPosition = React.useCallback(() => {
>         renderedElement.current?.measure((_frameOffsetX, _frameOffsetY, _width = 0, _height = 0, pageOffsetX = 0, pageOffsetY = 0) => {
|             isMounted.current &&
|                 setDimensions({
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Image/Image.js 18:15
Module parse failed: Unexpected token (18:15)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|             placeholderOpacity.current.setValue(0);
|         }
>         onLoad?.(event);
|     }, [transition, transitionDuration, onLoad]);
|     const hasImage = Boolean(props.source);
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/SpeedDial/SpeedDial.js 23:40
Module parse failed: Unexpected token (23:40)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                         opacity: animations.current[0],
|                         backgroundColor: overlayColor ||
>                             Color(theme?.colors?.black).alpha(0.6).rgb().toString(),
|                     },
|                 ] })),
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/ListItem/ListItem.js 23:43
Module parse failed: Unexpected token (23:43)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                     flexDirection: 'row',
|                     alignItems: 'center',
>                     backgroundColor: theme?.colors?.white,
|                     borderColor: theme?.colors?.divider,
|                 },
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Badge/Badge.js 27:43
Module parse failed: Unexpected token (27:43)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                     alignItems: 'center',
|                     justifyContent: 'center',
>                     backgroundColor: theme?.colors?.[status],
|                     borderWidth: StyleSheet.hairlineWidth,
|                     borderColor: '#fff',
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Skeleton/Skeleton.js 29:39
Module parse failed: Unexpected token (29:39)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                 width: width,
|                 height: height || 12,
>                 backgroundColor: theme?.colors?.grey4,
|             },
|             circle && {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/LinearProgress/LinearProgress.js 30:16
Module parse failed: Unexpected token (30:16)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     }, [variant, transition, animation, value]);
|     const tintColor = color === 'secondary' || color === 'primary'
>         ? theme?.colors?.[color]
|         : Color(color).rgb().string() || theme?.colors?.secondary;
|     const trackTintColor = trackColor || Color(tintColor).alpha(0.4).rgb().string();
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Divider/Divider.js 32:40
Module parse failed: Unexpected token (32:40)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     divider: {
|         borderBottomWidth: StyleSheet.hairlineWidth,
>         borderBottomColor: defaultTheme?.colors?.divider,
|     },
|     leftInset: {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Tile/Tile.js 32:54
Module parse failed: Unexpected token (32:54)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     return (React.createElement(Pressable, { ...{
|             onPress,
>             android_ripple: androidRipple(Color(theme?.colors?.primary).alpha(activeOpacity).rgb().toString()),
|             ...attributes,
|         }, style: StyleSheet.flatten([
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/FAB/FAB.js 37:52
Module parse failed: Unexpected token (37:52)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                         : styles.largeFAB,
|                 {
>                     backgroundColor: color || theme?.colors?.secondary,
|                 },
|                 buttonStyle,
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/ListItem/ListItem.Accordion.js 39:169
Module parse failed: Unexpected token (39:169)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|         React.createElement(ListItemBase, { ...rest },
|             React.isValidElement(content) ? content : React.createElement(ListItemContent, null),
>             !noIcon && (React.createElement(Animated.View, { testID: "RNE__ListItem__Accordion__Icon", style: iconAnimation }, renderNode(Icon, isExpanded ? expandIcon ?? icon : icon)))),
|         isExpanded && (React.createElement(Animated.View, { testID: "RNE__ListItem__Accordion__Children", style: {
|                 opacity: transition.current,
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/ListItem/ListItem.Swipeable.js 42:25
Module parse failed: Unexpected token (42:25)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|         onMoveShouldSetPanResponder: shouldSlide,
|         onPanResponderGrant: (_event, { vx }) => {
>             onSwipeBegin?.(vx > 0 ? 'left' : 'right');
|         },
|         onPanResponderMove: onMove,
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Slider/Slider.js 58:31
Module parse failed: Unexpected token (58:31)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|         const { size, setSize } = varInfo[name];
|         const rect = event.nativeEvent.layout;
>         const rectWidth = rect?.width ?? size.width;
|         const rectHeight = rect?.height ?? size.height;
|         const newSize = {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Switch/Switch.js 5:44
Module parse failed: Unexpected token (5:44)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { defaultTheme } from '../helpers';
| export const Switch = ({ value = false, disabled = false, onValueChange, color = 'primary', style, theme = defaultTheme, ...rest }) => {
>     const switchColor = useMemo(() => theme?.colors[color] || color || theme?.colors.primary, [color, theme?.colors]);
|     const trackColor = useMemo(() => Platform.select({
|         ios: switchColor,
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Tab/Tab.js 60:47
Module parse failed: Unexpected token (60:47)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     }, [animationRef, validChildren, tabItemPositions.current.length]);
|     const WIDTH = React.useMemo(() => {
>         return tabItemPositions.current[value]?.width;
|     }, [value, tabItemPositions.current.length]);
|     return (React.createElement(View, { ...rest, accessibilityRole: "tablist", style: [
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Dialog/Dialog.Loading.js 6:128
Module parse failed: Unexpected token (6:128)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| export const DialogLoading = ({ loadingStyle, loadingProps, theme = defaultTheme, }) => {
|     return (React.createElement(View, { style: styles.loadingView },
>         React.createElement(ActivityIndicator, { style: StyleSheet.flatten([styles.loading, loadingStyle]), color: loadingProps?.color ?? theme?.colors?.primary, size: loadingProps?.size ?? 'large', testID: "Dialog__Loading", ...loadingProps })));
| };
| DialogLoading.defaultProps = {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/ButtonGroup/ButtonGroup.js 6:549
Module parse failed: Unexpected token (6:549)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { normalizeText, color, androidRipple, defaultTheme, } from '../helpers';
| import { Text } from '../Text';
> export const ButtonGroup = ({ Component = Pressable, pressableProps, buttons, onPress = () => null, onLongPress, onPressIn, onPressOut, selectedIndex = null, selectedIndexes = [], selectMultiple = false, containerStyle, innerBorderStyle, buttonStyle, buttonContainerStyle, textStyle, selectedTextStyle, selectedButtonStyle, activeOpacity, onHideUnderlay, onShowUnderlay, setOpacityTo, disabled = false, disabledStyle, disabledTextStyle, disabledSelectedStyle, disabledSelectedTextStyle, vertical = false, theme = defaultTheme, underlayColor = theme?.colors?.primary, ...rest }) => {
|     let innerBorderWidth = innerBorderStyle?.width ?? 1;
|     return (React.createElement(View, { testID: "RNE__ButtonGroupContainer", ...rest, style: StyleSheet.flatten([
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/PricingCard/PricingCard.js 7:129
Module parse failed: Unexpected token (7:129)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { Text } from '../Text';
| import { PricingButton } from './components/PricingButton';
> export const PricingCard = ({ containerStyle, wrapperStyle, title, price, info = [], button, theme = defaultTheme, color = theme?.colors?.primary, titleStyle, pricingStyle, infoStyle, onButtonPress, ...rest }) => {
|     return (React.createElement(View, { ...rest, style: StyleSheet.flatten([
|             {
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/CheckBox/CheckBox.js 7:326
Module parse failed: Unexpected token (7:326)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { fonts } from '../helpers';
| import { color, defaultTheme } from '../helpers';
> export const CheckBox = ({ checked = false, Component = Pressable, iconRight = false, title, titleProps = {}, center = false, right = false, containerStyle, wrapperStyle, textStyle, checkedTitle, fontFamily, theme = defaultTheme, onPress, onLongPress, disabled = false, disabledStyle, disabledTitleStyle, checkedColor = theme?.colors?.primary, ...rest }) => {
|     const accessibilityState = {
|         checked: !!checked,
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Card/Card.js 7:39
Module parse failed: Unexpected token (7:39)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     return (React.createElement(View, { ...rest, style: StyleSheet.flatten([
|             {
>                 backgroundColor: theme?.colors?.white,
|                 borderWidth: 1,
|                 padding: 15,
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/base/dist/Button/Button.js 7:46
Module parse failed: Unexpected token (7:46)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { Icon } from '../Icon';
| const defaultLoadingProps = (type, theme) => ({
>     color: type === 'solid' ? 'white' : theme?.colors?.primary,
|     size: 'small',
| });
console.<computed> @ index.js:1
error @ react-native-logs.fx.ts:34
handleErrors @ webpackHotDevClient.js:174
../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:213
index.js:1 ./node_modules/@rneui/themed/dist/config/withTheme.js 7:58
Module parse failed: Unexpected token (7:58)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { defaultSpacing } from './theme';
| import { lightColors } from './colors';
> const isClassComponent = (Component) => Boolean(Component?.prototype?.isReactComponent);
| const combineByStyles = (propName = '') => {
|     if (propName.endsWith('Style') || propName.endsWith('style')) {

Expected behavior

project running without any errors

Describe the bug

Cannot use the @rneui/base and @rnui/themed in the project

Steps To Reproduce

Created a new Expo  project using: `npx create-expo-app`
Added the RNEUI base and themed packages: `npm install @rneui/base @rneui/themed`
started the project in web mode: `npm run web`

Screenshots

No response

Your Environment

package.json

{
  "name": "rne",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo/vector-icons": "^13.0.0",
    "@rneui/base": "^4.0.0-rc.6",
    "@rneui/themed": "^4.0.0-rc.6",
    "expo": "~45.0.0",
    "expo-status-bar": "~1.3.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-native": "0.68.2",
    "react-native-safe-area-context": "^4.3.1",
    "react-native-vector-icons": "^9.2.0",
    "react-native-web": "0.17.7"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9"
  },
  "private": true
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
yokowasiscommented, Aug 4, 2022

generate webpack using

expo customize:web

modify the webpack like in https://github.com/react-native-elements/react-native-elements/issues/3454#issuecomment-1106525159

const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function (env, argv) {
    const config = await createExpoWebpackConfigAsync(
        {
            ...env,
            babel: {
                dangerouslyAddModulePathsToTranspile: ['@rneui/base', '@rneui/themed'],
            },
        },
        argv
    )
    // Customize the config before returning it.
    return config;
};
0reactions
tallenbaughcommented, Aug 15, 2022

Hm, I’m having the same problem, but adding dangerouslyAddModulePathsToTranspile: ['@rneui/base', '@rneui/themed'], to my webpack unfortunately did not seem to help me 😦 (EDIT: My successful fix was reverting to 4.0.0-rc.4)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack throws "Module parse failed with Unexpected token ...
I get Module parse failed: Unexpected token. You may need an appropriate loader to handle this file type. error, though I already have ......
Read more >
Odyssey Lift-off I: "Module parse failed: Unexpected token" Error
Hello,. I am on the “useQuery hook” step attempting to implement the grid. Here is my code that I think is problematic:
Read more >
App.vue "Module parse failed: Unexpected token (1:0)"
Hi, I am trying to run my VUE project and get the following error in the log: ERROR in ./src/App.vue 1:0 Module parse...
Read more >
App.vue “Module parse failed: Unexpected token (1:0)” - MSDN
User1993186009 posted. Summary of the problem I am having: Hi,. I am facing the following issue while running ASPNET.
Read more >
module parse failed: unexpected token (1:0) you may need an ...
module parse failed : unexpected token (1:0) you may need an appropriate loader ... Answered on Sep 6, 2020 ... https://v4.webpack.js.org/loaders/raw-loader/.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found