Closed cspotcode closed 6 years ago
The published extension is invalid. tl;dr the compiled files are missing.
I saw the following in the Developer Tools:
[Extension Host] Here is the error stack: Error: Cannot find module '/Users/vincent/.vscode/extensions/apollographql.vscode-apollo-1.1.9/lib/extension'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:473:25)
Looking into the corresponding extension folder I saw that there is no lib folder. Checking with the downloadable .vsix file confirmed this.
You can get a working version from the source if you build the extension yourself with the npm install && npm run package-extension
(the result vscode-apollo-1.1.9.vsix file lands in the vscode-apollo folder. For whatever reason I also had to copy the node_modules/apollo-tools
inside the extension to node_modules/@apollographql/apollo-tools
.
Oh bummer. Is there a place to download an older version of the .vscx?
On Mon, Nov 12, 2018, 6:00 PM Vincent Schoettke notifications@github.com wrote:
The published extension is invalid. tl;dr the compiled files are missing.
I saw the following in the Developer Tools:
[Extension Host] Here is the error stack: Error: Cannot find module '/Users/vincent/.vscode/extensions/apollographql.vscode-apollo-1.1.9/lib/extension' at Function.Module._resolveFilename (module.js:543:15) at Function.Module._load (module.js:473:25)
Looking into the corresponding extension folder I saw that there is no lib folder. Checking with the downloadable .vsix file confirmed this.
You can get a working version from the source if you build the extension yourself with the npm install && npm run package-extension (the result vscode-apollo-1.1.9.vsix file lands in the vscode-apollo folder. For whatever reason I also had to copy the node_modules/apollo-tools inside the extension to node_modules/@apollographql/apollo-tools.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apollographql/apollo-tooling/issues/690#issuecomment-438059840, or mute the thread https://github.com/notifications/unsubscribe-auth/AAW-uGAjfUm5yknJUogBHF5xXGqvit9Nks5uuf2HgaJpZM4YahxU .
Apologies! Looks like I published a bad build earlier today. This should be fixed now with 1.1.10. Thank you for submitting the issue and suggesting workarounds in the mean time 👍
:( still having the same issue in 1.4.0
also tried 1.1.7 and 1.1.10 as suggested above, but it's all the same: command 'apollographql/reloadService' not found
@MrCroft is this still happening for you in v1.4.5
? We haven't heard any other complaints about this, nor have I been able to reproduce. If you don't mind, try deleting the downloaded version as well before reinstalling. On a mac, the extensions are stored at ~/.vscode/extensions/apollographql.vscode-apollo-x.x.x
Also having issues, and I just followed @trevor-scheer advice to delete the extension folder and reinstall the extension.
here is my apollo.config.js file at the root of the angular project alongside package.json
module.exports = {
client: {
service: {
name: 'bs-graphql',
localSchemaFile: './schema.json',
},
includes: ['./src/app/**/*.gql', './src/app/**/*.graphql'],
}
};
When I have the apollo.config.js file open in the editor and click the apollographql button on the bar at the bottom of VS Code, like this.
The console outputs:
🚀 Apollo GraphQL v1.4.5
------------------------------
✅ Service Loaded!
🆔 Service ID: bs-graphql
🏷 Schema Tag: current
📈 Number of Types: 535 (0 client types)
However when I do the same having any other file open than apollo.config.js
The console outputs:
🚀 Apollo GraphQL v1.4.5
------------------------------
❌ Service stats could not be loaded. This may be because you're missing an apollo.config.js file or it is misconfigured. For more information about configuring Apollo projects, see the guide here (https://bit.ly/2ByILPj).
@furier thanks for that info!
A couple things to try:
localSchemaFile
line. If your schema is published to engine, you probably don't need this.includes
. They look good to me, but we saw the same exact issue yesterday due to a misconfigured includes
key.Is it possible for you to share this project with me to reproduce locally? Or provide a minimum reproduction?
I have the exact same problems as @furier. Same Apollo GraphQL version. One of the other oddities is that when I switch to the OUTPUT tab, in the pulldown of services, I see Apollo GraphQL listed twice. One has no output, but the other has the output like in @furier screenshot. I think the service only loads one when VSCode starts up (the one with no output), but if you click the ApolloGraphQL in the status bar, the second one appears in the list and contains the output. Not sure if that's a problem, but wanted to mention it because that seems weird.
Unlike the OP, two of the three Apollo commands work for me (only Apollo:Show Status fails).
I also wanted to mention that there is another issue that mentions that folks can get Apollo GraphQL to work with Engine, but not with remote or local schema (#902 ), and so I wanted to mention that here in case theres some connection.
@furier, I got it working. It was a problem in the includes config. I made the change from includes: ['./examples/**/*.{ts,tsx}'],
to includes: ['examples/**/*.{ts,tsx}'],
and my syntax highlighting and auto-complete started working. And I no longer got the "❌ Service stats could not be loaded. . ." error message when in my component files. So it seems that the includes globs cannot start with ./
. This seems like a bug to me, since I would expect to be able to use either syntax (I prefer ./
).
I'm pretty sure that the problem lies in the line of code linked below, and it's based on the way path.relative()
works. So there will be no match with globs that start with ./
in the apollo-language-server
.
Or it could be the way minimatch() treats ./relative/**/*.{ts,tsx}
and relative/**/*.{ts,tsx}
differently, when they are essentially the same. I can't decide and would love to hear some other folks' input.
@warmbowski thanks for looking around, this is great information. Would you mind opening a new issue for this specifically? We'd love a PR that fixes this if anyone is interested in solving the issue 😄
@trevor-scheer thanks it works now with the path changes. :)
I have same issue with v1.6.4 also it was with v.1.5.2 it works with v 1.5.0 here is my appolo.config.js:
module.exports = {
client: {
service: {
name: 'localhost',
url: "http://localhost:5000/graphql",
},
skipSSLValidation: true,
excludes: ['node_modules/**/*'],
includes: ["src/**/*.{ts,gql,tsx,js,jsx,graphql}"],
},
};
for v 1.6.4:
🚀 Apollo GraphQL v1.6.4
------------------------------
❌ Service stats could not be loaded. This may be because you're missing an apollo.config.js file or it is misconfigured. For more information about configuring Apollo projects, see the guide here (https://bit.ly/2ByILPj).
for v 1.5.0:
------------------------------
🚀 Apollo GraphQL v1.5.0
------------------------------
✅ Service Loaded!
🆔 Service ID: localhost
🏷 Schema Tag: current
📈 Number of Types: 223 (0 client types)
------------------------------
Had this happen on Windows recently with the latest version. Uninstalling the extension, restarting VS Code, and reinstalling fixed the problem.
Had this happen on Windows recently with the latest version. Uninstalling the extension, restarting VS Code, and reinstalling fixed the problem.
This resolves the issue for me, after an hour of frustration. Thanks, man!
I still have the issue, re-installing does temporarily solve the issue, but after a while it crashes again. (version v1.19.6)
In case that matters, it's a test server running locally, and I can still ping the server for its schema manually so it's not a server problem.
Restarting vscode also seems to work.
In VSCode, I just upgraded to the Apollo extension version 1.1.9. Trying to invoke both contributed commands shows a VSCode "command not found" error.
How do I view logs for the extension? I'm not sure how to diagnose this issue.