-
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
Updated Cloud Functions README to reflect package name #1896
Conversation
The package name was different to this README, so I have updated the latter to reflect the actual package name - [apollo-server-cloud-function*s*](https://www.npmjs.com/package/apollo-server-cloud-functions)
@thetre97: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
@thetre97 The package is not compiled to js and because of that I couldn't import it in my function. Did you find and way to make it work? |
I used the NPM package, which is called apollo-server-cloud-functions, rather than 'apollo-server-cloud-function' (note the missing 's') as the guide says, hence I added this PR to update it. So I did: yarn add apollo-server-cloud-functions and const { ApolloServer, gql } = require('apollo-server-cloud-functions'); Then it worked fine with GC Functions Node8 runtime. Not sure if that is what you mean? |
Yes I know even I made the same PR for the README. Thanks. What version of the package is it? This is how it looks for me. No index.js file. This is the version "_id": "[email protected] |
Ah, i see - sorry. I was just using version 2.1.0 and I had no problems with it - everything worked fine. |
You are right - have just upgraded my function to v2.2.0, and it throws this error - ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function load error: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'apollo-server-cloud-functions'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/srv/index.js:3:26)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3) Try using v2.1.0 and see if it works for you? I downgraded to v2.1.0 again, and it deployed correctly. |
The `apollo-server-cloud-functions` has been been mis-referenced (or referenced inconsistently) since its original inception in #1446 when its package directory was `apollo-server-cloud-function` (singular!) and the `package.json` referenced the plural form (`apollo-server-cloud-functions`): 724d9ff0#diff-e1d725fd66f7e9ef5251abf0437a09ca These references have been mostly fixed in the READMEs and supporting documentation, but the underlying monorepo directory structure has still not been fixed, which I'm sure contributed to this module being overlooked and unreferenced in the move to TypeScript project references in #1772. Additionally, the lack of referencing in the monorepo's TS config has resulted in it being broken in the most recent 2.2.0 release, as reported by @pyros2097 and @thetre97 in: #1896 (comment) This should fix that by properly adding the TypeScript project references.
See #1948 for the suspected solution to #1896 (comment). Thanks for reporting this! |
…1948) * Add correct project references for `apollo-server-cloud-functions`. The `apollo-server-cloud-functions` has been been mis-referenced (or referenced inconsistently) since its original inception in #1446 when its package directory was `apollo-server-cloud-function` (singular!) and the `package.json` referenced the plural form (`apollo-server-cloud-functions`): 724d9ff0#diff-e1d725fd66f7e9ef5251abf0437a09ca These references have been mostly fixed in the READMEs and supporting documentation, but the underlying monorepo directory structure has still not been fixed, which I'm sure contributed to this module being overlooked and unreferenced in the move to TypeScript project references in #1772. Additionally, the lack of referencing in the monorepo's TS config has resulted in it being broken in the most recent 2.2.0 release, as reported by @pyros2097 and @thetre97 in: #1896 (comment) This should fix that by properly adding the TypeScript project references. * Sorting.
The package name was different to this README, so I have updated the latter to reflect the actual package name - apollo-server-cloud-functions
TODO: