Prettier not following the configuration for ruby on VSCode - ruby

Here is my User/settings.json:
{
"workbench.colorTheme": "Dracula",
"workbench.iconTheme": "material-icon-theme",
"editor.fontFamily": "D2Coding",
"editor.detectIndentation": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.tabWidth": 4
"remote.SSH.remotePlatform": {
"xxx.xxx.xxx.xxx": "linux"
},
"tabnine.experimentalAutoImports": true,
"prettier.printWidth": 250
}
The default formatter is set to use prettier and I do have ruby gem, nvm package and vscode extension for prettier installed properly.
I have tested with a local configuration (.prettierrc) which only has tabWidth:
{
"tabWidth": 4
}
and it is working fine for the JavaScript as you can see the below.
Before formatting JavaScript:
After formatting JavaScript:
Before formatting Ruby:
After formatting Ruby:
The following is the output of Prettier which has nothing special.
["INFO" - 9:37:22 PM] Formatting file:///home/user/test_project/main.js
["INFO" - 9:37:22 PM] Using config file at '/home/user/test_project/.prettierrc'
["INFO" - 9:37:22 PM] Using ignore file (if present) at /home/user/test_project/.prettierignore
["INFO" - 9:37:22 PM] File Info:
{
"ignored": false,
"inferredParser": "babel"
}
["INFO" - 9:37:22 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 9:37:22 PM] Prettier Options:
{
"filepath": "/home/user/test_project/main.js",
"parser": "babel",
"tabWidth": 4
}
["INFO" - 9:37:22 PM] Formatting completed in 0.012ms.
["INFO" - 9:39:02 PM] Formatting file:///home/user/test_project/main.rb
["INFO" - 9:39:02 PM] Using config file at '/home/user/test_project/.prettierrc'
["INFO" - 9:39:02 PM] Using ignore file (if present) at /home/user/test_project/.prettierignore
["INFO" - 9:39:02 PM] File Info:
{
"ignored": false,
"inferredParser": "ruby"
}
["INFO" - 9:39:02 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 9:39:02 PM] Prettier Options:
{
"filepath": "/home/user/test_project/main.rb",
"parser": "ruby",
"tabWidth": 4
}
["INFO" - 9:39:03 PM] Formatting completed in 0.036ms.
Am I missing something at some point?
I literally tried every solutions suggested here, but no luck :/

Related

IntelliJ Idea command line code inspection fails

I am trying to set up command line code inspection with IntelliJ Idea, but the program seems to crash. The project builds with Gradle.
I get the following errors (full stack trace below)
2022-11-11 09:17:13,214 [ 15890] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - Gradle resolve failure <unnamed>:0
com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
It is not clear which directory it is trying to access, and I have not been able to reproduce this error by calling Gradle directly. This error also appears when I run Idea graphically, and it seems to work just fine so it might be a red herring. But in that case I have no idea what's wrong.
Any help pointing me in the right direction would be very welcome!
build.gradle:
plugins {
id 'application'
id 'java-library'
}
repositories {
maven {
url '/opt/java-deps'
}
}
dependencies {
implementation 'org.apache.commons:commons-csv:1.8'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.junit.jupiter:junit-jupiter:5.7.2'
}
sourceSets {
main {
java {
srcDirs = ['src', 'generated']
}
resources {
srcDirs = ['src']
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Werror" << "-Xlint:all"
}
tasks.withType(Javadoc) {
options {
showAll()
// https://github.com/gradle/gradle/issues/2354
addStringOption("Xwerror", "-quiet")
}
}
}
test {
useJUnitPlatform()
}
application {
mainClass = 'tests.Main'
}
settings.gradle:
rootProject.name = 'vt'
Stack trace (some of the stack traces are trimmed due to post size limits):
vkl#debian:~/*$ idea inspect . .idea/inspections/Project_Default.xml inspection
2022-11-11 09:16:59,517 [ 2193] WARN - #c.i.n.i.NotificationGroupManagerImpl - Notification group CodeWithMe is already registered (group=com.intellij.notification.NotificationGroup#52ca8e3). Plugin descriptor: PluginDescriptor(name=Code With Me, id=com.jetbrains.codeWithMe, descriptorPath=plugin.xml, path=/opt/intellij_idea/plugins/cwm-plugin, version=221.5591.52, package=null, isBundled=true)
Info | RdCoroutineScope | 10:JobScheduler FJ pool 0/4 | RdCoroutineHost overridden
2022-11-11 09:17:09,115 [ 11791] SEVERE - #c.i.o.a.i.FlushQueue - null
java.awt.HeadlessException
at java.desktop/javax.swing.JTree.checkDragEnabled(JTree.java:1222)
at java.desktop/javax.swing.JTree.setDragEnabled(JTree.java:1216)
at com.intellij.openapi.vcs.changes.ui.ChangesListView.<init>(ChangesListView.java:59)
at com.intellij.openapi.vcs.changes.ChangesViewPanel$MyChangesListView.<init>(ChangesViewPanel.kt:89)
at com.intellij.openapi.vcs.changes.ChangesViewPanel.<init>(ChangesViewPanel.kt:30)
at com.intellij.openapi.vcs.changes.ChangesViewManager$ChangesViewToolWindowPanel.<init>(ChangesViewManager.java:353)
at com.intellij.openapi.vcs.changes.ChangesViewManager.initToolWindowPanel(ChangesViewManager.java:179)
at com.intellij.openapi.vcs.changes.ChangesViewManager.updateCommitWorkflow(ChangesViewManager.java:272)
at com.intellij.openapi.vcs.changes.ChangesViewManager.lambda$new$0(ChangesViewManager.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:639)
at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:621)
at com.intellij.util.messages.impl.MessageBusImpl.access$300(MessageBusImpl.java:34)
at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.executeOrAddToQueue(MessageBusImpl.java:209)
at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl.access$scheduleWithinConstraints$s1153900543(BaseExpirableExecutorMixinImpl.kt:12)
at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl$scheduleWithinConstraints$$inlined$Runnable$1.run(Runnable.kt:19)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:215)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:197)
at
...
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
2022-11-11 09:17:09,137 [ 11813] SEVERE - #c.i.o.a.i.FlushQueue - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:09,139 [ 11815] SEVERE - #c.i.o.a.i.FlushQueue - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:09,141 [ 11817] SEVERE - #c.i.o.a.i.FlushQueue - OS: Linux
2022-11-11 09:17:09,671 [ 12347] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,675 [ 12351] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,676 [ 12352] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,677 [ 12353] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,679 [ 12355] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,680 [ 12356] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,682 [ 12358] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,685 [ 12361] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,700 [ 12376] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,719 [ 12395] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored files under another root: 48 files total
2022-11-11 09:17:12,825 [ 15501] WARN - #c.a.t.i.g.p.s.i.SyncIssueUsageReporterImpl - Multiple sync failures reported. Discarding: SDK_BUILD_TOOLS_TOO_LOW
2022-11-11 09:17:13,214 [ 15890] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - Gradle resolve failure <unnamed>:0
com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionErrorHandler.createUserFriendlyError(GradleExecutionErrorHandler.java:197)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:46)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.doGetUserFriendlyError(BaseProjectImportErrorHandler.java:167)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:48)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.checkErrorsWithoutQuickFixes(BaseProjectImportErrorHandler.java:62)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.getUserFriendlyError(GradleProjectResolver.java:877)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:806)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:775)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$0(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.maybeFixSystemProperties(GradleExecutionHelper.java:165)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$1(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.GradleConnectorService$Companion.withGradleConnection(GradleConnectorService.kt:181)
at org.jetbrains.plugins.gradle.GradleConnectorService.withGradleConnection(GradleConnectorService.kt)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:130)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:154)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:74)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:43)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:36)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:48)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:115)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:151)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:135)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.executeImpl(ExternalSystemUtil.java:491)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.lambda$execute$0(ExternalSystemUtil.java:327)
at com.intellij.openapi.project.DumbServiceHeavyActivities.suspendIndexingAndRun(DumbServiceHeavyActivities.java:21)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:190)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:327)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:614)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressInCurrentThread$10(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressInCurrentThread(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:381)
at com.intellij.openapi.progress.Task.queue(Task.java:119)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:616)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:282)
at com.intellij.openapi.externalSystem.service.project.autoimport.ProjectAware.reloadProject(ProjectAware.kt:62)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.reloadProject(AutoImportProjectTracker.kt:141)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.access$reloadProject(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:76)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:103)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.update.PriorityEatUpdate$Companion$invoke$1.run(PriorityEatUpdate.kt:15)
at com.intellij.util.ui.update.MergingUpdateQueue.queue(MergingUpdateQueue.java:347)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.schedule(AutoImportProjectTracker.kt:98)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.scheduleProjectRefresh(AutoImportProjectTracker.kt:76)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.importProjects(GradleCommandLineProjectConfigurator.kt:95)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:75)
at com.intellij.codeInspection.InspectionApplicationBase.configureProject(InspectionApplicationBase.java:462)
at com.intellij.codeInspection.InspectionApplicationBase.lambda$runUnderProgress$22(InspectionApplicationBase.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.codeInspection.InspectionApplicationBase.runUnderProgress(InspectionApplicationBase.java:697)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysis(InspectionApplicationBase.java:492)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysisOnScope(InspectionApplicationBase.java:449)
at ...
2022-11-11 09:17:13,227 [ 15903] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:13,228 [ 15904] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:13,229 [ 15905] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - OS: Linux
2022-11-11 09:17:13,266 [ 15942] WARN - #c.a.t.i.g.p.s.GradleSyncState - Gradle sync failed in 2 s 236 ms. The project directory does not exist!
2022-11-11 09:17:15,351 [ 18027] SEVERE - #c.i.c.InspectionApplicationBase - java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator$StateNotificationListener.waitForImportEnd(GradleCommandLineProjectConfigurator.kt:196)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:76)
at com.intellij.codeInspection.InspectionApplicationBase.configureProject(InspectionApplicationBase.java:462)
at com.intellij.codeInspection.InspectionApplicationBase.lambda$runUnderProgress$22(InspectionApplicationBase.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.codeInspection.InspectionApplicationBase.runUnderProgress(InspectionApplicationBase.java:697)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysis(InspectionApplicationBase.java:492)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysisOnScope(InspectionApplicationBase.java:449)
at com.intellij.codeInspection.InspectionApplicationBase.run(InspectionApplicationBase.java:221)
at com.intellij.codeInspection.InspectionApplicationBase.execute(InspectionApplicationBase.java:159)
at com.intellij.codeInspection.InspectionApplicationBase.startup(InspectionApplicationBase.java:123)
at com.intellij.codeInspection.InspectionMain.main(InspectionMain.java:115)
at com.intellij.openapi.application.ApplicationStarter.main(ApplicationStarter.java:52)
at com.intellij.idea.ApplicationLoader$initApplication$4.accept(ApplicationLoader.kt:176)
at com.intellij.idea.ApplicationLoader$initApplication$4.accept(ApplicationLoader.kt)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1742)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1728)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator$StateNotificationListener.onFailure(GradleCommandLineProjectConfigurator.kt:179)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$TaskListenerWrapper.onFailure(ExternalSystemProgressNotificationManagerImpl.kt:106)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:120)
at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:85)
at com.sun.proxy.$Proxy120.onFailure(Unknown Source)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$onFailure$1.invoke(ExternalSystemProgressNotificationManagerImpl.kt:65)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$onFailure$1.invoke(ExternalSystemProgressNotificationManagerImpl.kt:17)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl.forEachListener(ExternalSystemProgressNotificationManagerImpl.kt:90)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl.onFailure(ExternalSystemProgressNotificationManagerImpl.kt:65)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:56)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:115)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:151)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:135)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.executeImpl(ExternalSystemUtil.java:491)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.lambda$execute$0(ExternalSystemUtil.java:327)
at com.intellij.openapi.project.DumbServiceHeavyActivities.suspendIndexingAndRun(DumbServiceHeavyActivities.java:21)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:190)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:327)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:614)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressInCurrentThread$10(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressInCurrentThread(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:381)
at com.intellij.openapi.progress.Task.queue(Task.java:119)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:616)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:282)
at com.intellij.openapi.externalSystem.service.project.autoimport.ProjectAware.reloadProject(ProjectAware.kt:62)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.reloadProject(AutoImportProjectTracker.kt:141)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.access$reloadProject(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:76)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:103)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.update.PriorityEatUpdate$Companion$invoke$1.run(PriorityEatUpdate.kt:15)
at com.intellij.util.ui.update.MergingUpdateQueue.queue(MergingUpdateQueue.java:347)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.schedule(AutoImportProjectTracker.kt:98)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.scheduleProjectRefresh(AutoImportProjectTracker.kt:76)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.importProjects(GradleCommandLineProjectConfigurator.kt:95)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:75)
... 28 more
Caused by: com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionErrorHandler.createUserFriendlyError(GradleExecutionErrorHandler.java:197)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:46)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.doGetUserFriendlyError(BaseProjectImportErrorHandler.java:167)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:48)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.checkErrorsWithoutQuickFixes(BaseProjectImportErrorHandler.java:62)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.getUserFriendlyError(GradleProjectResolver.java:877)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:806)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:775)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$0(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.maybeFixSystemProperties(GradleExecutionHelper.java:165)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$1(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.GradleConnectorService$Companion.withGradleConnection(GradleConnectorService.kt:181)
at ...
2022-11-11 09:17:15,378 [ 18054] SEVERE - #c.i.c.InspectionApplicationBase - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:15,380 [ 18056] SEVERE - #c.i.c.InspectionApplicationBase - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:15,382 [ 18058] SEVERE - #c.i.c.InspectionApplicationBase - OS: Linux
java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
vkl#debian:~/*$ echo $?
1
vkl#debian:~/*$ ls inspection/

Failure loading tarball from GitHub to Heroku using Terraform heroku_build resource

I am working on creating a CI Pipeline using Github Actions, Terraform and Heroku. My example application is a Jmix application from Mario David (rent-your-stuff) that I am building according to his Youtube videos. Unfortunately, the regular Github integration he suggests has been turned off due to a security issue. If you attempt to use Heroku's "Connect to GitHub" button, you get an Internal Service Error.
So, as an alternative, I have changed my private repo to public and I'm trying to directly download via the Terraform heroku_build Source.URL (see the "heroku_build" section):
terraform {
required_providers {
heroku = {
source = "heroku/heroku"
version = "~> 5.0"
}
herokux = {
source = "davidji99/herokux"
version = "0.33.0"
}
}
backend "remote" {
organization = "eraskin-rent-your-stuff"
workspaces {
name = "rent-your-stuff"
}
}
required_version = ">=1.1.3"
}
provider "heroku" {
email = var.HEROKU_EMAIL
api_key = var.HEROKU_API_KEY
}
provider "herokux" {
api_key = var.HEROKU_API_KEY
}
resource "heroku_app" "eraskin-rys-staging" {
name = "eraskin-rys-staging"
region = "us"
}
resource "heroku_addon" "eraskin-rys-staging-db" {
app_id = heroku_app.eraskin-rys-staging.id
plan = "heroku-postgresql:hobby-dev"
}
resource "heroku_build" "eraskin-rsys-staging" {
app_id = heroku_app.eraskin-rys-staging.id
buildpacks = ["heroku/gradle"]
source {
url = "https://github.com/ericraskin/rent-your-stuff/archive/refs/heads/master.zip"
}
}
resource "heroku_formation" "eraskin-rsys-staging" {
app_id = heroku_app.eraskin-rys-staging.id
type = "web"
quantity = 1
size = "Standard-1x"
depends_on = [heroku_build.eraskin-rsys-staging]
}
Whenever I try to execute this, I get the following build error:
-----> Building on the Heroku-20 stack
! Push rejected, Failed decompressing source code.
Source archive detected as: Zip archive data, at least v1.0 to extract
More information: https://devcenter.heroku.com/articles/platform-api-deploying-slugs#create-slug-archive
My assumption is that Heroku can not download the tarball, but I can successfully download it without any authentication using wget.
How do I debug this? Is there a way to ask Heroku to show the commands that the build stack is executing?
For that matter, is there a better approach given that the normal GitHub integration pipeline is broken?
I have found a workaround for this issue, based on the notes from Heroku. They suggest using a third-party GitHub Action Deploy to Heroku instead of Terraform. To use it, I removed my heroku_build and heroku_formation from my main.tf file, so it just contains this:
resource "heroku_app" "eraskin-rys-staging" {
name = "eraskin-rys-staging"
region = "us"
}
resource "heroku_addon" "eraskin-rys-staging-db" {
app_id = heroku_app.eraskin-rys-staging.id
plan = "heroku-postgresql:hobby-dev"
}
My GitHub workflow now contains:
on:
push:
branches:
- master
pull_request:
jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout#v3
- name: Setup Terraform
uses: hashicorp/setup-terraform#v1
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Format
id: fmt
working-directory: ./infrastructure
run: terraform fmt
- name: Terraform Init
id: init
working-directory: ./infrastructure
run: terraform init
- name: Terraform Validate
id: validate
working-directory: ./infrastructure
run: terraform validate -no-color
- name: Terraform Plan
id: plan
if: github.event_name == 'pull_request'
working-directory: ./infrastructure
run: terraform plan -no-color -input=false
continue-on-error: true
- name: Update Pull Request
uses: actions/github-script#v6
if: github.event_name == 'pull_request'
env:
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
with:
script: |
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ️⚙️\`${{ steps.init.outcome }}\`
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`\n
${process.env.PLAN}
\`\`\`
</details>
*Pusher: #${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1
- name: Terraform Apply
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
working-directory: ./infrastructure
run: terraform apply -auto-approve -input=false
heroku-deploy:
name: 'Heroku-Deploy'
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
runs-on: ubuntu-latest
needs: terraform
steps:
- name: Checkout App
uses: actions/checkout#v3
- name: Deploy to Heroku
uses: akhileshns/heroku-deploy#v3.12.12
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_NAME}}
heroku_email: ${{secrets.HEROKU_EMAIL}}
buildpack: https://github.com/heroku/heroku-buildpack-gradle.git
branch: master
dontautocreate: true
The workflow has two "phases". On the pull request, it runs the tests in my application, followed by terraform fmt, terraform init and terrform plan. On a merge to my master branch, it runs the terraform apply. When that completes, it runs the second job that runs the akhileshns/heroku-deploy#v3.12.12 GitHub action.
As far as I can tell, it works. YMMV, of course. ;-)

Terraform custom provider GPG issue

hope you're doing well.
I'm writing an API using in Go that can works similarly to the terraform provider protocol
So I already have two endpoints working on my local machine over HTTPS:
https://myapi:9000/v1/provider/:namespace/:type/versions
https://myapi:9000/v1/provider/:namespace/:type/:version/download/:os/:arch
Let's say for example these full endpoint:
https://myapi:9000/v1/provider/myprovider/custom/versions
https://myapi:9000/v1/provider/myprovider/custom/0.1.0/download/linux/amd64
So I have the next .tf.json file:
{
"module": {
"linux": {
"source": "myapi:9000/v1/module/mymodule/custom",
"version": "0.1.2"
}
}
}
That uses this two files
provider.tf.json
provider "mycustomprovider" {
username = "abc"
password = "def"
host = "yjk"
}
versions.tf.json
terraform {
required_providers {
mycustomprovider = {
source: "myapi:9000/v1/myprovider/custom",
version: "0.1.0"
}
}
required_version = ">=1.0.2"
}
Then I simply run: terraform init to get my assets.
So, when I'm getting my custom module, that works fine.
Output (module download):
Initializing modules...
Downloading myapi:9000/mymodule/custom/gnu 0.1.2 for linux...
- linux in .terraform/modules/linux
Initializing the backend...
But when I'm getting my provdier I have this error:
Initializing provider plugins...
- Finding myapi:9000:9000/myprovider/custom versions matching "0.1.0"...
- Installing myapi:9000:9000/myprovider/custom v0.1.0...
╷
│ Error: Failed to install provider
│
│ Error while installing myapi:9000/myprovider/custom v0.1.0: error checking signature:
│ openpgp: invalid data: tag byte does not have MSB set
So, my provider versions endpoint is working. That's why terraform is able to recognize the version of my provider.
The problem should be on my download endpoint.
Before talking about this endpoint I want to add some context, I'm running a S3 client using localstack and exposing it through ngrok. These two things work and I able to upload or download files without problem.
Terraform custom providers should have three files (as I understand):
the provider in zip format (like in their example)
a provider_SHA256SUMS file with the shasums of each provider zip file (in this case I'm only have one)
a provider_SHA256SUMS.sig that is uses to recognize the integrity of the provider_SHA256SUMS file.
So to get these files I'm running these commands:
provider_SHA256SUMS
$ sha256sum 0.1.0.zip > 0.1.0_SHA256SUMS
provider_SHA256SUMS
$ gpg --gen-key # generating a new key
$ gpg --armor --output 0.1.0_SHA256SUMS.sig --detach-sig 0.1.0_SHA256SUMS
The response with my endpoint is something like this. (the gpg info is just sample data, no real warning here.)
{
"protocols": [
"5.0"
],
"os": "linux",
"arch": "amd64",
"filename": "0.1.0.zip",
"download_url": "https://d4f6-186-84-89-138.ngrok.io/terraform/v1/providers/myprovider/custom/0.1.0.zip",
"shasums_url": "https://d4f6-186-84-89-138.ngrok.io/terraform/v1/providers/myprovider/custom/0.1.0_SHA256SUMS",
"shasums_signature_url": "https://d4f6-186-84-89-138.ngrok.io/terraform/v1/providers/myprovider/custom/0.1.0_SHA256SUMS.sig",
"shasum": "1dd61b508aad0d65b32c71159775e409fd618adc5ba945cc2eebb42f29e085d3",
"signing_keys": {
"gpg_public_keys": [
{
"key_id": "9F21EA3C1C9F793C",
"ascii_armor": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n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\nCZWzoNTMkeFkob1UkxIe+Q==\n=wZDI\n-----END PGP PUBLIC KEY BLOCK-----"
}
]
}
}
The shasum prop in the response should be a shasum corresponding to the provider zip file, it can also be found inside the provider_SHA256SUMS file.
To get the key_id and ascii_armor props I'm running this commands:
$ gpg --list-secret-keys --keyid-format=long ## key_id
$ gpg --armor --export <MY_KEYID> > public.gpg ## export to public key to base64
$ cat public.gpg | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' ## one-lined ascii_armor
Short Question
What am I doing wrong with the gpg key to get this error? Am I lacking of steps, or doing everything wrong?
openpgp: invalid data: tag byte does not have MSB set
----Update----
This is how I'm building the response in Go:
I'm not putting the full code because I belive that the problem is with the KeyID and ASCIIArmor atributes.
As you can see: Shasum, KeyID and ASCIIArmor are hardcoded.
response := ProviderDownloadResponse{
Protocols: protocols,
Os: os,
Arch: arch,
Filename: filename,
DownloadURL: downloadURL,
ShasumsURL: SHASUMsURL,
ShasumsSignatureURL: SHASUMSSignatureURL,
Shasum: "1dd61b508aad0d65b32c71159775e409fd618adc5ba945cc2eebb42f29e085d3",
SigningKeys: SigningKeys{
GpgPublicKeys: []GPGPublicKey{
{
KeyID: "9F21EA3C1C9F793C",
ASCIIArmor: "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n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\nCZWzoNTMkeFkob1UkxIe+Q==\n=wZDI\n-----END PGP PUBLIC KEY BLOCK-----",
},
},
},
}
x/crypto/openpgp that is used by terraform does not support reading armored messages, see issue, this is where the error comes from.
shasums_signature_url filed doc mentions:
binary, detached GPG signature
Also, see Manually preparing a release doc
which is a valid GPG binary (not ASCII armored) signature
So you should try signing without --armor flag.

Magento Grunt child theme compilation fails to update merged style files

I've set up the Grunt workflow as described here:
https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css_debug.html
My local-themes.js looks like this:
➜ m2 git:(master) ✗ cat dev/tools/grunt/configs/local-themes.js
'use strict';
module.exports = {
ac_default: {
area: 'frontend',
name: 'Ac/Default',
locale: 'en_US',
files: [
'css/source/_extend',
],
dsl: 'less'
},
ac_retail: {
area: 'frontend',
name: 'Ac/Retail',
locale: 'en_US',
files: [
'css/source/_extend',
],
dsl: 'less'
},
ac_wholesale: {
area: 'frontend',
name: 'Ac/Wholesale',
locale: 'en_US',
files: [
'css/source/_extend',
],
dsl: 'less'
}
};
I grunt watch successfully triggers when a less file in my child theme gets changed:
➜ m2 git:(master) ✗ grunt watch:ac_retail -v
Initializing
Command-line options: --verbose, --gruntfile=/data/src/m2/Gruntfile.js
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
+ black-list-generator, clean-black-list, default, deploy, documentation, legacy-build, mage-minify, prod, refresh, spec, static
Running tasks: watch:ac_retail
Loading "grunt-contrib-watch" plugin
Registering "/data/src/m2/node_modules/grunt-contrib-watch/tasks" tasks.
Loading "watch.js" tasks...OK
+ watch
Running "watch:ac_retail" (watch) task
Waiting...
Verifying property watch exists in config...OK
Verifying property watch.ac_retail.files exists in config...OK
Live reload server started on *:35729
Watching pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less for changes.
>> File "pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less" changed.
Initializing
Command-line options: --verbose, --gruntfile=/data/src/m2/Gruntfile.js
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
+ black-list-generator, clean-black-list, default, deploy, documentation, legacy-build, mage-minify, prod, refresh, spec, static
Running tasks: less:ac_retail
Loading "grunt-contrib-less" plugin
Registering "/data/src/m2/node_modules/grunt-contrib-less/tasks" tasks.
Loading "less.js" tasks...OK
+ less
Running "less:ac_retail" (less) task
Verifying property less.ac_retail exists in config...OK
Files: pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less -> pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css
Options: banner="", sourceMap, strictImports=false, sourceMapRootpath="/", dumpLineNumbers=false, ieCompat=false
Reading pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less...OK
Writing pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css.map...OK
File pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css.map created.
Writing pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css...OK
File pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css created
>> 1 stylesheet created.
>> 1 sourcemap created.
Done.
Execution Time (2019-01-16 16:13:35 UTC-8)
loading tasks 42ms ▇▇▇▇▇▇▇▇▇▇▇▇▇ 39%
loading grunt-contrib-less 34ms ▇▇▇▇▇▇▇▇▇▇ 32%
less:ac_retail 31ms ▇▇▇▇▇▇▇▇▇ 29%
Total 107ms
Live reloading pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less...
Completed in 0.729s at Wed Jan 16 2019 16:13:35 GMT-0800 (Pacific Standard Time) - Waiting...
Unfortunately the styles-m.css or styles-l.css files are not updated. Therefore when I refresh the page the changes made in the less files are not reflected on the page.
I posted a ticket in the Magento bug tracker but they have not been particularly helpful.
https://github.com/magento/magento2/issues/20356
My question is. Does anyone here uses Grunt to compile less for a setup with multiple child themes?
In my case the intended theme inheritance looks like this:
ac_retail inherits from ac_default inherits from luma
ac_wholesale inherits from ac_default inherits from luma
From what I can tell the Grunt workflow is the only workflow that is actually suitable for theme development. Server and client side compilation are way too slow to use for development.
Finally figured it out. The documentation has errors. You need to specify the parent themes style files, even if your child theme has it's own root source files, if you want to re-compile styles-m.css and styles-l.css, when the child themes less files change. This local-themes.js ended up working for me:
>>'use strict';
>>module.exports = {
ac_default: {
area: 'frontend',
name: 'Ac/Default',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l',
],
dsl: 'less'
},
ac_retail: {
area: 'frontend',
name: 'Ac/Retail',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l',
],
dsl: 'less'
},
ac_wholesale: {
area: 'frontend',
name: 'Ac/Wholesale',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l',
],
dsl: 'less'
}
};
adding
'css/styles-m',
'css/styles-l',
fixed it for me too. Thanks for this

Karma proxies are not working

I am using Karma (v0.12.37) as test runner along with JSPM (v0.16.2). I have added following proxy config in karma so as to allow proper loading of JSPM files:
proxies: {
'/base/jspm_packages/': '/base/app/jspm_packages/'
}
Bu this doesn't work out and fails on following:
PhantomJS 2.0.0 (Windows 8 0.0.0) ERROR: 'Potentially unhandled rejection [10] Error: XHR error loading http://localhost:9876/base/jspm_packages/npm/babel-core#5.8.22.js
Error loading http://localhost:9876/base/jspm_packages/npm/babel-core#5.8.22.js
Error loading http://localhost:9876/base/app/pages/examples/todo-example/todo.controller.test.js'
Debug Logs are giving:
proxying request - /base/jspm_packages/npm/babel-core#5.8.22.js to localhost:9876
/base/app/jspm_packages/npm/babel-core#5.8.22.js { host: 'localhost',
port: 9876,
baseProxyUrl: '/base/app/jspm_packages/',
https: false }
But the following url containing 'app' in it works properly:
http ://localhost:9876/base/ app/ jspm_packages/npm/babel-core#5.8.22.js
Any clue on what is going wrong?
Try:
proxies: {
'/app/': '/base/app/',
'/jspm_packages/': '/base/jspm_packages/'
}
If you have configured your jspm-config with a baseUrl of "/", try removing the baseUrl entry since karma-jspm does not support a custom baseUrl. Then you should be able to get rid of the "proxies" entry for the jspm_packages.
See: https://github.com/Workiva/karma-jspm/issues/91
After having done lot of trial and error, found out the following way:
Instead of playing with proxies, alter the jspm paths config in karma.config.js
jspm: {
...
paths: {
"github:*": "app/jspm_packages/github/*",
"npm:*": "app/jspm_packages/npm/*",
'app/*': 'app/*.js'
},
...
},
What finally did the trick for me (karma, babel, JSPM/SystemJS) was to have this:
Remove baseUrl from the karma.conf.js and have this jspm section:
jspm: {
config: 'config.js',
loadFiles: [
'www/**/*.spec.js'
],
serveFiles: [
'www/**/!(*spec).js'
],
paths: {
"github:*": "/base/jspm_packages/github/*",
"npm:*": "/base/jspm_packages/npm/*",
'www/*': '/base/www/*'
}
},

Resources