magento / magento/magento2-phpstorm-plugin

java.lang.NoClassDefFoundError: Could not initialize class com.intellij.lang.javascript.psi.util.JSDirectiveCommentLexer

Open
#2,446 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
463
Forks
98
Avg merge
1h 6m
Merged PRs (30d)
3

Description

Describe the bug (*)

A clear and concise description of what the bug is.

java.lang.NoClassDefFoundError: Could not initialize class com.intellij.lang.javascript.psi.util.JSDirectiveCommentLexer
	at com.intellij.lang.javascript.index.JSIdAndTodoScanner$JSFilterLexer.<init>(JSIdAndTodoScanner.java:98)
	at com.intellij.lang.javascript.index.JSIdAndTodoScanner.createLexer(JSIdAndTodoScanner.java:92)
	at com.intellij.psi.impl.cache.impl.BaseFilterLexerUtil.calcIdEntries(BaseFilterLexerUtil.java:32)
	at com.intellij.lang.javascript.index.JSIdAndTodoScanner.scanContent(JSIdAndTodoScanner.java:71)
	at com.intellij.lang.javascript.index.JSIdAndTodoScanner.calcIdEntries(JSIdAndTodoScanner.java:55)
	at com.intellij.lang.javascript.index.JSIdIndexer.map(JSIdIndexer.java:18)
	at com.intellij.lang.javascript.index.JSIdIndexer.map(JSIdIndexer.java:11)
	at com.intellij.psi.impl.cache.impl.id.IdIndex$2.map(IdIndex.java:98)
	at com.intellij.psi.impl.cache.impl.id.IdIndex$2.map(IdIndex.java:73)
	at com.intellij.util.indexing.CompositeDataIndexer.map(CompositeDataIndexer.java:55)
	at com.intellij.util.indexing.CompositeDataIndexer.map(CompositeDataIndexer.java:19)
	at com.intellij.util.indexing.impl.MapReduceIndex.mapByIndexer(MapReduceIndex.java:385)
	at com.intellij.util.indexing.impl.MapReduceIndex.mapInput(MapReduceIndex.java:376)
	at com.intellij.util.indexing.impl.MapReduceIndex.mapInputAndPrepareUpdate(MapReduceIndex.java:301)
	at com.intellij.indexing.composite.CompositeInvertedIndexBase.updateBaseIndex(CompositeInvertedIndexBase.java:287)
	at com.intellij.indexing.composite.CompositeInvertedIndexBase.mapInputAndPrepareUpdate(CompositeInvertedIndexBase.java:64)
	at com.intellij.indexing.composite.CompositeInvertedIndexBase.mapInputAndPrepareUpdate(CompositeInvertedIndexBase.java:29)
	at com.intellij.util.indexing.FileBasedIndexImpl.createSingleIndexValueApplier(FileBasedIndexImpl.java:1641)
	at com.intellij.util.indexing.FileBasedIndexImpl.lambda$doIndexFileContent$21(FileBasedIndexImpl.java:1512)
	at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.lambda$freezeFileTypeTemporarilyWithProvidedValueIn$14(FileTypeManagerImpl.java:752)
	at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.cacheFileTypesInside(FileTypeManagerImpl.java:822)
	at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyWithProvidedValueIn(FileTypeManagerImpl.java:748)
	at com.intellij.util.indexing.FileBasedIndexImpl.doIndexFileContent(FileBasedIndexImpl.java:1465)
	at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1440)
	at com.intellij.util.indexing.FileBasedIndexImpl.processRefreshedFile(FileBasedIndexImpl.java:1380)
	at com.intellij.util.indexing.FileBasedIndexImpl$VirtualFileUpdateTask.doProcess(FileBasedIndexImpl.java:1754)
	at com.intellij.util.indexing.FileBasedIndexImpl$VirtualFileUpdateTask.doProcess(FileBasedIndexImpl.java:1748)
	at com.intellij.util.indexing.UpdateTask.process(UpdateTask.java:63)
	at com.intellij.util.indexing.UpdateTask.processAll(UpdateTask.java:32)
	at com.intellij.util.indexing.FileBasedIndexImpl.forceUpdate(FileBasedIndexImpl.java:1771)
	at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:854)
	at com.intellij.util.indexing.FileBasedIndexEx.readIndexAndProcessExceptions(FileBasedIndexEx.java:336)
	at com.intellij.util.indexing.FileBasedIndexEx.processValueIterator(FileBasedIndexEx.java:431)
	at com.intellij.util.indexing.FileBasedIndexEx.getValues(FileBasedIndexEx.java:133)
	at com.magento.idea.magento2plugin.indexes.JsIndex.getRequireJsPreferences(JsIndex.java:46)
	at com.magento.idea.magento2plugin.reference.provider.RequireJsPreferenceReferenceProvider.getReferencesByElement(RequireJsPreferenceReferenceProvider.java:20)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:164)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:145)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:124)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:44)
	at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:173)
	at com.intellij.psi.impl.AbstractPsiCachedValue.doCompute(PsiCachedValueImpl.kt:21)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:299)
	at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:37)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:299)
	at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:113)
	at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:29)
	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68)
	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:300)
	at com.intellij.psi.impl.AbstractPsiCachedValue.getValue(PsiCachedValueImpl.kt:15)
	at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:83)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:170)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:136)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:42)
	at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.createRefs(JSLiteralExpressionImpl.java:117)
	at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.lambda$getReferences$0(JSLiteralExpressionImpl.java:101)
	at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:173)
	at com.intellij.psi.impl.AbstractPsiCachedValue.doCompute(PsiCachedValueImpl.kt:21)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:299)
	at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:37)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:29

To Reproduce (*)

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior (*)

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following information: (*)

  • OS: Windows 11.0
  • PhpStorm/Intellij version: 2024.3
  • Plugin Version: 5.3.1

Additional context

Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack trace entries for JSDirectiveCommentLexer, JSIdAndTodoScanner, and the plugin's JsIndex and RequireJsPreferenceReferenceProvider. Reproduce on Windows 11 with PhpStorm/IntelliJ 2024.3 and plugin version 5.3.1; done means indexing and RequireJS reference handling no longer produce the reported NoClassDefFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.