-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Class constructor RESTDataSource cannot be invoked without 'new' using Babel #1550
Comments
Can you verify that you are using version 0.1.4 apollo-datasource-rest? I saw this error when using an older version, and it was fixed by upgrading the package. If you are, I would delete the npm modules/reinstall etc to ensure it's not using the old version, just to confirm before diagnosing further. https://github.com/seanli3/apoll-datasource-rest-bug-report/pull/1/files |
Yes, currently using version 0.1.4 of apollo-datasource-rest according to my yarn.lock file and I removed my node_modules folder and re-installed my packages just to be sure. I am still getting the same error. |
I created a stripped down project that will reproduce the error that I'm getting. https://github.com/danlunde/datasource-test. Doing a graphQL |
@danlunde - I added a pull request to your example repo, it seemed to have resolved the error, can you review? I'm not a babel expert, I just swapped out a few dev dependencies to what I use for starter repos and I didn't get any errors afterward. |
I didn't add it in, but I like to write the babel transpile result to a folder usually, to see what is actually getting written. If in dev mode, it sometimes helps see where the error is. |
@sbrichardson - That's a great tip, thank you. And thanks also for helping me understand babel a little more. This definitely solved my problem! |
No problem! Could this issue be closed? |
Yes, and thank you again! |
I have tried all the workarounds I could find and still have the issue. Could this be reopened? |
Very similar in nature to #1388, but I'm using Babel, not TypeScript
When using babel with
apollo-datasource-rest
I am getting theClass constructor RESTDataSource cannot be invoked without 'new'
. Here's a simplified version of my code.Is there any way that I can utilize
apollo-datasource-rest
with babel?The text was updated successfully, but these errors were encountered: