Skip to content

Cannot read property 'length' of undefined appears without a workspace opened #26

@sean-mcmanus

Description

@sean-mcmanus

When I open a project without a workspace, I get a warning icon on the bottom that says "Failed to cache the CSS classes on the workspace" and when I click on it it gives an error popup that says "Cannot read property 'length' of undefined'. Can you handle the no workspace scenario better, such as silently not doing anything? With multiple CSS extensions enabled, it's not obvious which one is causing this.

htmlcssclasscompletionerror

This is the Debug Console output:

Found all parseable documents.
Parsing documents and looking for CSS class definitions...
Sumary:
Failed while looping through the documents to cache the classes definitions: TypeError: Cannot read property 'length' of undefined
at async.each (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\out\src\extension.js:46:33)
at iteratorSymbol (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:486:20)
at C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:855:24
at eachOfLimit (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:915:26)
at FUNC_ERROR_TEXT$1 (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:920:20)
at eachOf (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:1052:9)
at Object.eachLimit (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:3111:7)
at C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\out\src\extension.js:29:26
at next (native)
at fulfilled (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\out\src\extension.js:4:58)
at process._tickCallback (internal/process/next_tick.js:103:7)
Activating extension Zignd.html-css-class-completion failed: Cannot read property 'length' of undefined.
Activating extension Zignd.html-css-class-completion failed: Cannot read property 'length' of undefined
Here is the error stack: TypeError: Cannot read property 'length' of undefined
at async.each (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\out\src\extension.js:46:33)
at iteratorSymbol (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:486:20)
at C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:855:24
at eachOfLimit (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:915:26)
at FUNC_ERROR_TEXT$1 (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:920:20)
at eachOf (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:1052:9)
at Object.eachLimit (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\node_modules\async\dist\async.js:3111:7)
at C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\out\src\extension.js:29:26
at next (native)
at fulfilled (C:\Users\seanmcm.vscode\extensions\Zignd.html-css-class-completion-1.0.2\out\src\extension.js:4:58)
at process._tickCallback (internal/process/next_tick.js:103:7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions