Unable to resolve any new file I add

#1

Hello good people, I’m having a troublesome issue and I’m at a standstill with my development.

Everytime I try to use Expo, it is unable to resolve additional files that I try to add to the project.

For example, after building a clean project, running expo on my device has been fine, real time updates working as expected. As soon as I add a new file and import it, it is unable to resolve it. Yes, I’m positive the file is there.

Unable to resolve "./components/NewFile" from "App.js"

This is the same issue I have with expo on any tutorial I try to follow.

My current stats:

yarn -v 1.12.3
“expo”: “^31.0.2”,
“react”: “16.5.0”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz

Any help would be greatly appreciated.

#2

Hey @bauervision,

Sorry you’re experiencing these issues. Can you try running expo start -c to clear your packager cache and see if that helps at all?

Cheers,

Adam

#3

No change. Here is the log

You can see its also complaining about those default images inside of .assets that I removed.

Here is my entire App.js

import React from 'react';
import {
  StyleSheet,
  Text,
  KeyboardAvoidingView,
  Platform,
  TextInput
} from 'react-native';
import SearchInput from './components/SearchInput';

export default class App extends React.Component {
  render() {
    return (
      <KeyboardAvoidingView style={styles.container} behavior="padding">
        <Text style={[styles.largeText, styles.textStyle]}>San Francisco</Text>
        <Text style={[styles.smallText, styles.textStyle]}>Light Cloud</Text>
        <Text style={[styles.largeText, styles.textStyle]}>24°</Text>

        <SearchInput placeholder="Search any city" />
      </KeyboardAvoidingView>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center'
  },
  blue: {
    color: 'blue'
  },
  textStyle: {
    textAlign: 'center',
    fontFamily: 'Roboto'
  },
  largeText: {
    fontSize: 44
  },
  smallText: {
    fontSize: 18
  },
  textInput: {
    backgroundColor: '#666',
    color: 'white',
    height: 40,
    width: 300,
    marginTop: 20,
    marginHorizontal: 20,
    paddingHorizontal: 10,
    alignSelf: 'center',
    borderRadius: 8
  }
});

It’s like it’s not updating, but I have cleared the cache.

#4

Hey @bauervision, sorry that you’re having this issue with Expo CLI.

To fully clear the internal state of the CLI, could you try removing the .expo folder in your project folder and then restarting (again) with expo start -c? Also make sure that you’re running the start command from your project root folder.

If that doesn’t help, could you also copy paste the contents of your app.json and the output from running expo diagnostics?

#5

thanks for getting back with me @fson, none of my projects are working now. I’m trying to do a clean install in a fresh project but I can’t get past it crashing on install:

It hangs on this line:

finalize:@expo/traveling-fastlane-darwin: sill finalize C:\Users\AppData\Roaming\npm\node_modules\expo-cli\node_modules

and then crashes

npm ERR! path C:\Users\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink ‘C:\Users\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll’
npm ERR! { Error: EPERM: operation not permitted, unlink ‘C:\Users\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll’
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink ‘C:\Users\AppData\Roaming\npm\node_modules\expo-cli\node_modules.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll’
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘unlink’,
npm ERR! path: ‘C:\Users\\AppData\Roaming\npm\node_modules\expo-cli\node_modules\.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll’ },
npm ERR! stack: ‘Error: EPERM: operation not permitted, unlink ‘C:\Users\\AppData\Roaming\npm\node_modules\expo-cli\node_modules\.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll’’,
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘unlink’,
npm ERR! path: ‘C:\Users\\AppData\Roaming\npm\node_modules\expo-cli\node_modules\.xdl.DELETE\binaries\windows\adb\AdbWinUsbApi.dll’,
npm ERR! parent: ‘expo-cli’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

I’m stuck

#6

This looks like a problem with permissions. Could you manually delete the folder at C:\Users\AppData\Roaming\npm\node_modules\expo-cli (you may need to use an Admin user) and then re-install expo-cli?

#7

Ok that got me past the install issue, will redo the app now and report back, thanks

#8

@fson Same issue. Unable to resolve the new file.

expo diagnostics:

Expo CLI 2.4.3 environment info:
    System:
      OS: Windows 10
    Binaries:
      Yarn: 1.12.3 - C:\Users\Mike.Bauer\AppData\Roaming\npm\yarn.CMD
      npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.2.0.0 AI-181.5540.7.32.5014246

  Diagnostics report:
\[09:50:08] Request failed with status code 500
[09:50:08] Set EXPO_DEBUG=true in your env to view the stack trace.

app.json:

{
  "expo": {
    "name": "weather-app",
    "description": "This project is really great.",
    "slug": "weather-app",
    "privacy": "public",
    "sdkVersion": "31.0.0",
    "platforms": ["ios", "android"],
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    }
  }
}

I add a new file under /src/components, and import it into App.js, and it can’t resolve it.

I deleted the .expo folder and ran expo start -c, same result.

I did add the file while the metro bundler was running, then once it returned unresolved, I realized this and closed it. But still the same result

Then just to be sure, I restarted VSCode and same result.

#9

I guess I need to hold off on expo

closed #10

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