Skip to content

"Unexpected String" error when running Expo app #438

@alexmahan

Description

@alexmahan

Describe the issue

When running the web version of the Expo app with the npx expo start --web --clear command, we are getting this error:

Web Bundling failed 2898ms src/app/index.ts (334 modules)
 ERROR  src/app/strict.css: Unexpected string

Expected behavior

Running npx expo start --web --clear should start the web app without errors.

Steps to reproduce

I'm using the code provided in the example Expo app

After installing the dependencies, the app should be ready to run.

When I run npx expo start --web --clear in the app root, this error occurs:

Web Bundling failed 2898ms src/app/index.ts (334 modules)
 ERROR  src/app/strict.css: Unexpected string

Test case

No response

Additional comments

Our index.js file contains this code:

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

// Required for CSS to work on Expo Web.
import './strict.css';
// Required for Fast Refresh to work on Expo Web
import '@expo/metro-runtime';

import { registerRootComponent } from 'expo';
import { LogBox } from 'react-native';
import App from '../components/App';

if (LogBox != null) {
  LogBox.ignoreLogs([
    // /React Strict DOM: .*/,
    // /Failed prop type: .*/,
  ]);
}

registerRootComponent(App);

Strict.css contains this code:

/* This directive is used by the react-strict-dom postcss plugin. */
/* It is automatically replaced with generated CSS during builds. */
@react-strict-dom;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions