Class constructor FirestoreAdapter cannot be invoked without 'new'
See original GitHub issueI’m trying out v3 on a new 3.8 app and running into this error when trying to access this.store
in a controller:
Class constructor FirestoreAdapter cannot be invoked without ‘new’
I believe this is the same error @zoltan-nz pointed out on #553.
e.g.
DEBUG: -------------------------------
DEBUG: Ember : 3.8.0
DEBUG: Ember Data : 3.8.0
DEBUG: jQuery : 3.3.1
DEBUG: EmberFire : 3.0.0-rc.1-4
DEBUG: Firebase : 5.9.1
DEBUG: -------------------------------
Test case
I can provide a repo if needed
Expected behavior
I can use the store! 😃
Actual behavior
I see this error message:
Uncaught TypeError: Class constructor FirestoreAdapter cannot be invoked without ‘new’
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Class constructor model cannot be invoked without 'new' - ...
When I run my app, an error appears: TypeError: Class constructor model cannot be invoked without 'new' at line 17 which is the...
Read more >Class constructor MongoStore cannot be invoked without 'new'
TypeError: Class constructor MongoStore cannot be invoked without ' new 'https://stackoverflow.com/questions/66654037/mongo-connect-error-with ...
Read more >Class constructor SweetAlert cannot be invoked without ...
Hi, After updating meteor version, I can not use the sweetalert2 npm package. import swal from 'sweetalert2'; import { TAPi18n } from ...
Read more >Data Transformation using Cloud Firestore Converters
Protect your app by using typed class Models in your Firestore ... The FirestoreConverter feature is not drastically different from a ...
Read more >I upgrade to 1.17.0, got many problem
TypeError : Class constructor AbstractViewContribution cannot be invoked without 'new'. in my code, I write like this: class ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bnetter I found a workaround, but not sure how other things it’ll break, I’m actually right now testing for a project.
The problem seems related to babel and the way it handles native classes, when searching in Google I found a lot of “solutions” that pointed to exclude
'transform-es2015-classes'
and'transform-classes'
from babel, also usingtarget: 'node'
; but again, I’m not very sure how to set/configure that.Well, the workaround I’ve just see that allows me to build the project is to add
ie 11
in the build targets. The easiest way is to change theconfig/targets.js
file like this:Well, it can be done properly just removing the
if
or adding theie 11
to the array of browsers, but well that’s basically the point.The first problem I’ve found it’s that when using Fastboot
emberfire
wants to importXMLHttpRequest
, and it breaks the build; but that is more a general Fastboot issue, that I vaguely remember I solved beforeI also had this and it went away after upgrading ember-source. Maybe version +3.5? Didn’t need to touch targets.js.