Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please improve the documentation #287

Closed
natalia-sulkama opened this issue Jun 7, 2019 · 5 comments
Closed

Please improve the documentation #287

natalia-sulkama opened this issue Jun 7, 2019 · 5 comments

Comments

@natalia-sulkama
Copy link

Hi, I am very new to Vue and Firebase, so I wanted to try Vuefire. However I feel that the "Getting Started" section is a bit lacking and I can't even get my very first Vuefire project to run as I keep getting an error about this specific line:

export { TimeStamp, GeoPoint } = firebase.firestore

All other Vuefire tutorials I've found on the internet also seem to be for an outdated version, so it's difficult to understand what is wrong.

Perhaps I am just too inexperienced?

@posva
Copy link
Member

posva commented Jun 7, 2019

You are not even saying the error you have nor the environment you are trying to make it work with: is it with vue-cli, nuxt, an HTML page? This gives me no information about what to improve 😕
Anyway, I added an entry to #145

@posva posva closed this as completed Jun 7, 2019
@coinpusha
Copy link

Hi, I am very new to Vue and Firebase, so I wanted to try Vuefire. However I feel that the "Getting Started" section is a bit lacking and I can't even get my very first Vuefire project to run as I keep getting an error about this specific line:

export { TimeStamp, GeoPoint } = firebase.firestore

All other Vuefire tutorials I've found on the internet also seem to be for an outdated version, so it's difficult to understand what is wrong.

Perhaps I am just too inexperienced?

The documentation does seem to be incomplete. I've used previous versions of Vuefire and the configuration is really different. Hi, that syntax looks off in the line you mentioned. Try just using

export { TimeStamp, GeoPoint }

I'm not sure if that's even needed if you don't plan on using TimeStamp or GeoPoint. Previous versions of firestore required a timestamp settings configuration but I think the newer versions of the sdk don't require that anymore.

@coinpusha
Copy link

coinpusha commented Jun 11, 2019

I checked my old projects and the older version is still working. It looks from the changelog, that this version is still in Alpha, which would explain why the docs are incomplete.

@natalia-sulkama
Copy link
Author

natalia-sulkama commented Jun 12, 2019

You are not even saying the error you have nor the environment you are trying to make it work with: is it with vue-cli, nuxt, an HTML page? This gives me no information about what to improve 😕
Anyway, I added an entry to #145

I'm sorry, I completely forgot to provide any actual info - I am using vue-cli, and the error is the following:

SyntaxError: .../db.js: Unexpected token, expected ";" (7:31)

   5 | 
   6 | // Export types that exists in Firestore
 > 7 | export { TimeStamp, GeoPoint } = firebase.firestore
     |                                ^
   8 | 
   9 | // if using Firebase JS SDK < 5.8.0
  10 | db.settings({ timestampsInSnapshots: true })

The documentation does seem to be incomplete. I've used previous versions of Vuefire and the configuration is really different. Hi, that syntax looks off in the line you mentioned. Try just using

export { TimeStamp, GeoPoint }

I'm not sure if that's even needed if you don't plan on using TimeStamp or GeoPoint. Previous versions of firestore required a timestamp settings configuration but I think the newer versions of the sdk don't require that anymore.

I also realised that this line was not needed at least in my case, so eventually I managed to get Vuefire to work with my app. But I believe at least for less experienced programmers such as myself the documentation is a little vague - in addition to the export { TimeStamp, GeoPoint } = firebase.firestore confusion, Vuefire would not work at least in my case by just following the documentation which I think is pretty disorienting.

In the Getting Started page, there is no mention of actually including Firebase itself before adding the Vuefire tutorial code for getting a Firestore instance. Even if this may seem completely obvious to most people, I believe it's worth noting for clarity's sake:

var firebase = require("firebase/app");
require("firebase/firestore");

// Get a Firestore instance
export const db = firebase
  .initializeApp({ projectId: 'project-id' })
  .firestore()

I hope this helps 🙂Thank you for the great plugin!

@posva
Copy link
Member

posva commented Jun 30, 2019

Thanks, that makes more sense! I adapted the export statement and added a comment to the relevant section in both vuefire and vuexfire docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants