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.

Please improve the documentation

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
natalia-sulkamacommented, 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!

0reactions
posvacommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Tips for Improving Documentation | CloudApp Blog
Effective documentation improves workplace productivity and efficiency. Think about it: easy to understand documents help new employees learn their jobs faster.
Read more >
The 5 easiest ways to improve any document (even if English ...
The 5 easiest ways to improve any document (even if English is your second language) · First, focus on your reader. The most...
Read more >
How To Improve Documentation Efficiency - YouTube
Documentation got you staying late after work or bring your charts home to finish later? I had the same problem before but now...
Read more >
10 things you can do to create better documentation
New technologies will continue to be created to help create more effective documentation that is less costly to develop. Look at these new...
Read more >
Please improve the documentation · Issue #403 - GitHub
Currently I'm trying to configure commitlint. I've been spending the entire day trying to put it to run. I followed all the steps...
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