Skip to content

Failed to cache the CSS classes in the workspace for the first time: Cannot read property 'map' of undefined #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nathonius opened this issue Feb 5, 2018 · 13 comments
Labels

Comments

@nathonius
Copy link

Insiders 1.20.0.
Intellisense for CSS class names 1.16.1
Windows 10

I get this error any time I open VS Code without a workspace. With a folder/workspace, things work as expected:
Failed to cache the CSS classes in the workspace for the first time: Cannot read property 'map' of undefined

I can click for another attempt, but just get the same error again.

@nathonius
Copy link
Author

capture24

@zignd zignd added the bug label Feb 5, 2018
@NoXPhasma
Copy link

I get the same error message since version 1.20.0 of VSCode.

@almadsen
Copy link

almadsen commented Feb 8, 2018

Get same on Mac, since VSCode 1.20.0

Anyone on fixing it?

@Lin-Hongqing
Copy link

After updated to 1.20.0,I get this error too.

@jens1o
Copy link

jens1o commented Feb 9, 2018

Can reproduce this with an empty workspace.

@jkwuc89
Copy link

jkwuc89 commented Feb 9, 2018

This happens every time I start Visual Studio Code 1.20.

@texjoachim
Copy link

Happens here in VSC 1.20.0 on openSUSE Tumbleweed, too.

@Almenon
Copy link

Almenon commented Feb 10, 2018

same issue

/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:253 [Extension Host] VError: Failed to cache the CSS classes in the workspace for the first time: Cannot read property 'map' of undefined
at C:\Users\Almenon.vscode\extensions\Zignd.html-css-class-completion-1.16.1\out\src\extension.js:158:19
at Generator.throw ()
at rejected (C:\Users\Almenon.vscode\extensions\Zignd.html-css-class-completion-1.16.1\out\src\extension.js:5:65)
at (at C:\Users\Almenon.vscode\extensions\Zignd.html-css-class-completion-1.16.1\out\src\extension.js:159:21)

full log: https://pastebin.com/5KTcTwT0

Windows 10, version 1.20.0 of VSCode

From looking at your code it looks like "BlueBird" is undefined for some reason:

https://github.com/zignd/HTML-CSS-Class-Completion/blob/master/src/extension.ts#L42

@zignd zignd closed this as completed in b8f8090 Feb 10, 2018
@zignd
Copy link
Owner

zignd commented Feb 10, 2018

There's a bug in the latest version of the API in which calling vscode.workspace.findFiles when the extension is not being executed inside a workspace, causes a "Cannot read property 'map' of undefined" error to be thrown from inside of it.

I will release a new version in a moment. Thanks for the report guys.

@Almenon I thought it was Bluebird initially, but it happened a few lines before this map call.

@jens1o
Copy link

jens1o commented Feb 10, 2018

@zignd I wonder why you cannot use activationEvents like

 "activationEvents": [
    "onLanguage:css",
    "workspaceContains:**/*.css"
],

@zignd
Copy link
Owner

zignd commented Feb 10, 2018

@jens1o That's actually a great idea. And there's no particular reason, I think the way it is right now is just what came to mind when I created the extension. I will keep that in mind!

@jens1o
Copy link

jens1o commented Feb 10, 2018

@zignd May I file a new issue for that?

@zignd
Copy link
Owner

zignd commented Feb 10, 2018

@jens1o Yup, go ahead. Will help me not forget. Thanks XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants