react-native-static-server icon indicating copy to clipboard operation
react-native-static-server copied to clipboard

TypeError: null is not an object (evaluating 'FPStaticServer.start')

Open codthing opened this issue 3 years ago • 6 comments

When I run server.start, I get an error

Bug

image

Code

image

Version Info

image

codthing avatar Jan 19 '21 14:01 codthing

Any solution on this error?

dohomi avatar Sep 21 '21 05:09 dohomi

I was getting this error when I was trying to spin up the static server while running in Expo Go. Building for native platforms with react-native run-ios || react-native run-android solved it for me.

shynonagons avatar Sep 29 '21 17:09 shynonagons

@shynonagons how are you developing if Expo Go is not building? Maybe a custom dev-client could work?

dohomi avatar Sep 30 '21 01:09 dohomi

@dohomi In short, I don’t use expo-system anymore, I use react-native-system. Also, I use declare module'react-native-static-server'.

codthing avatar Sep 30 '21 01:09 codthing

@dohomi This module uses native code, so you can't run it in Expo Go. If you need to use it in an Expo project you'll have to eject first with expo eject.

@fungmo for the types I just copied the contents of the index.d.ts file in this repo into react-native-static-server.d.ts in my project, since it doesn't seem like the release with Typescript support has been cut yet.

shynonagons avatar Sep 30 '21 02:09 shynonagons

I have the same problem, i'm using bare react native. I'm using react-native-fs from a module i linked in my app from an another private github project and i have the same issue when i want to start static server to launch a webview in my project.

danidji avatar Dec 13 '21 14:12 danidji