-
Notifications
You must be signed in to change notification settings - Fork 263
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
v3 missing firebase.database.ServerValue.TIMESTAMP? #589
Comments
The proper way is: import firebase from 'firebase/app';
firebase.database.ServerValue.TIMESTAMP Note due to an outstanding bug with how the Firebase modules are defined this will throw an error in type-checking. But it's actually correct. If yu don't care about Node.js support this will work: import * as firebase from 'firebase/app';
firebase.database.ServerValue.TIMESTAMP |
Thanks, I tried both of your suggestions but I'm seeing this with rc.6?
import DS from 'ember-data'
// import firebase from 'firebase/app'
import * as firebase from 'firebase/app'
const {Model, attr, belongsTo, hasMany} = DS
export default Model.extend({
created: attr('number', {
defaultValue() {
return firebase.database.ServerValue.TIMESTAMP
}
}),
channels: hasMany('channel'),
settings: belongsTo('user-setting')
}) and compiled version define("xxx/models/user", ["exports", "ember-data", "firebase/app"], function (_exports, _emberData, firebase) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
const {
Model,
attr,
belongsTo,
hasMany
} = _emberData.default;
var _default = Model.extend({
created: attr('number', {
defaultValue() {
return firebase.database.ServerValue.TIMESTAMP;
}
}),
channels: hasMany('channel'),
settings: belongsTo('user-setting')
});
_exports.default = _default;
}); |
interesting, wonder if auto-import is pruning some dependencies... |
I'm planning on adding new data types to the adapter that will do stuff like this for you, I'll leave open for that. |
Probably can be close with the Firebase Js V9 API !
|
In v2 you could do
but in v3
ServerValue
is not defined. What is the right import path? https://firebase.google.com/docs/reference/js/firebase.database.ServerValue.htmlI tried accessing
database.ServerValue
from:import firebase from 'firebase'
import firebase from 'firebase/app'
firebase: service()
firebaseApp: service()
The text was updated successfully, but these errors were encountered: