Just opening the IDE.
Stacktrace:
Unable to start JS GraphQL Language Service using Node.js with commandline /usr/local/bin/node [/Users/blackxored/Library/Application Support/IntelliJIdea2018.1/js-graphql-intellij-plugin/js-graphql-language-service.dist.js, --port=64744]
java.lang.Throwable: Unable to start JS GraphQL Language Service using Node.js with commandline /usr/local/bin/node [/Users/blackxored/Library/Application Support/IntelliJIdea2018.1/js-graphql-intellij-plugin/js-graphql-language-service.dist.js, --port=64744]
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123)
at com.intellij.lang.jsgraphql.languageservice.JSGraphQLNodeLanguageServiceInstance.createProcessHandler(JSGraphQLNodeLanguageServiceInstance.java:143)
at com.intellij.lang.jsgraphql.languageservice.JSGraphQLNodeLanguageServiceInstance.<init>(JSGraphQLNodeLanguageServiceInstance.java:83)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at com.intellij.lang.jsgraphql.languageservice.JSGraphQLNodeLanguageServiceClient.getJSGraphQLNodeLanguageServiceInstance(JSGraphQLNodeLanguageServiceClient.java:118)
at com.intellij.lang.jsgraphql.languageservice.JSGraphQLNodeLanguageServiceClient.executeRequest(JSGraphQLNodeLanguageServiceClient.java:71)
at com.intellij.lang.jsgraphql.languageservice.JSGraphQLNodeLanguageServiceClient.executeRequest(JSGraphQLNodeLanguageServiceClient.java:66)
at com.intellij.lang.jsgraphql.languageservice.JSGraphQLNodeLanguageServiceClient.getSchemaWithVersion(JSGraphQLNodeLanguageServiceClient.java:62)
at com.intellij.lang.jsgraphql.schema.ide.project.JSGraphQLSchemaLanguageProjectService.getOrCreateSchemaFileElements(JSGraphQLSchemaLanguageProjectService.java:626)
at com.intellij.lang.jsgraphql.schema.ide.project.JSGraphQLSchemaLanguageProjectService.getSchemaFile(JSGraphQLSchemaLanguageProjectService.java:115)
at com.intellij.lang.jsgraphql.schema.ide.project.JSGraphQLSchemaDirectoryNode.getChildren(JSGraphQLSchemaDirectoryNode.java:53)
at com.intellij.ide.util.treeView.AbstractTreeStructureBase.getChildElements(AbstractTreeStructureBase.java:33)
at com.intellij.ui.tree.StructureTreeModel.getValidChildren(StructureTreeModel.java:229)
at com.intellij.ui.tree.StructureTreeModel.getNode(StructureTreeModel.java:139)
at com.intellij.ui.tree.StructureTreeModel.isLeaf(StructureTreeModel.java:175)
at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.load(AsyncTreeModel.java:576)
at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.getNode(AsyncTreeModel.java:551)
at com.intellij.ui.tree.AsyncTreeModel$ObsolescentCommand.get(AsyncTreeModel.java:444)
at com.intellij.ui.tree.AsyncTreeModel$ObsolescentCommand.get(AsyncTreeModel.java:410)
at com.intellij.util.concurrency.Command$Processor.lambda$process$1(Command.java:48)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1134)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:84)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$2(ProgressIndicatorUtils.java:140)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:138)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:84)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:105)
at com.intellij.util.concurrency.Invoker.invokeSafely(Invoker.java:114)
at com.intellij.util.concurrency.Invoker.lambda$invokeSafely$1(Invoker.java:123)
at com.intellij.util.concurrency.Invoker$BackgroundThread.lambda$offer$0(Invoker.java:248)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:228)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
node -v
v10.0.0
IntelliJ IDEA 2018.1.3 EAP (Ultimate Edition)
Build #IU-181.4892.5, built on April 26, 2018
Licensed to Adrian Perez
Subscription is active until December 29, 2018
JRE: 1.8.0_152-release-1136-b34 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.4
Hi Adrian.
Please verify that you've configured Idea correctly to use Node.js. The most common issue is having a wrong configuration after updating Node.js.
If the IDE configuration looks correct, you can verify by right-clicking on your package.json -> "Show NPM" and double-clicking one of the scripts to run them with your Node.js config.
If that's all in order, please include the complete stack trace. There should be a "caused by" which provides actionable info.
Unable to start JS GraphQL Language Service using Node.js with commandline /usr/local/bin/node [/Users/userName/Library/Application Support/WebStorm2018.1/js-graphql-intellij-plugin/js-graphql-language-service.dist.js, --port=50367]
@jimkyndemeyer My node config is fine. The file seems to load just fine as well. There's no "caused by" in the stacktrace.
The console (after I dismiss the exception dialog), just shows this:
(node:127) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
JS GraphQL listening on http://127.0.0.1:60692/js-graphql-language-service
However, some part of the plugin seems to have unloaded at that point as I can't get syntax highlighting, etc.
This is caused by https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor
The plugin expects no errors from the console output during startup of the Node.js process handler: https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/blob/734657f4c31e6e167a1574eb4c4e9ae87d8c869b/src/main/com/intellij/lang/jsgraphql/languageservice/JSGraphQLNodeLanguageServiceInstance.java#L292-L295
I was able to get the error to go away by using Buffer.from in the language service, but found a handful of dependencies that will also need to be upgraded.
I've created https://github.com/jimkyndemeyer/js-graphql-language-service/issues/20 as follow up.
For now I recommend reverting back to Node 9.x. If that's not an option, manually patching new Buffer(string) in js-graphql-language-service.dist.js can serve as a temporary work-around.
Hello! Sorry I'm not sure I'm following with the workaround (patch) -- what should we be modifying exactly?
Here's instructions for a temp-fix using a patched version of the language service that uses Buffer.alloc and Buffer.from to be compatible with Node 10:
This is a temp-fix only, and might be unstable. I still recommend using Node 9 with the plugin.
The first step is to locate the js-graphql-language-service.dist.js language service file by clicking on the IDE errors in the lower right (flashing red "(!)" icon). Click it and you should see the location as part of the stack trace, e.g. Unable to start JS GraphQL Language Service using Node.js with commandline C:\Program Files\nodejs\node.exe [C:\Users\example\.IntelliJIdea2017.3\config\plugins\js-graphql-intellij-plugin\js-graphql-language-service.dist.js, --port=16604]
Grab the patched language service from https://github.com/jimkyndemeyer/js-graphql-language-service/blob/node-10-patch/node-10-patch/js-graphql-language-service.dist.js and overwrite the original previously located.
Thank you, that worked for now! For upcoming updates to the plugin, will this file be overwritten normally?
Yes, the plugin compares the modified timestamp, and overwrites if the bundled version is newer.
Thanks for the patch. When I override the dist file it works for a bit, but then gets replaced with the old version of the js file when I open the IDE again (WebStorm config). Any ideas what might be doing that? I tried clearing the cache, but seems like the IDE has the old version of the "official" version of file stashed away somewhere.
Any chance of getting a new version cut, with experimental support for Node 10?
@jimkyndemeyer I'm getting the same error (Unable to start JS GraphQL Language Service) but not with the Buffer reason in the error. I'm using node 8.11.1, and node seems to be working fine. Should I open a new issue?
@jazzdragon No need. The underlying issue is likely the same. Based on https://nodejs.org/docs/latest/api/buffer.html#buffer_buffer_from_buffer_alloc_and_buffer_allocunsafe the deprecation was introduced with Node 6.
Fixed in 1.7.1, pending JetBrains approval in the plugin repo.
Any chance we could get an update of the Android Studio plugin as well? It's currently unusable without this fix.
@ValCanBuild I just pushed a 0.2.0 version with this fix based on Android Studio 3.1.1. Get it from https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/tree/android-studio#faq
Most helpful comment
Fixed in 1.7.1, pending JetBrains approval in the plugin repo.