Skip to content

TypeError: Cannot read property 'includes' of undefined #183

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
Scrum opened this issue Jan 19, 2018 · 5 comments
Closed

TypeError: Cannot read property 'includes' of undefined #183

Scrum opened this issue Jan 19, 2018 · 5 comments
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@Scrum
Copy link
Owner

Scrum commented Jan 19, 2018

based on #181 (comment)

Nice 😄

However, I just tested it and I now get this error:

 ERROR  Failed to compile with 5 errors                                                                                                                                                                    15:59:33

 error  in ./src/views/ViewHomepage.vue

Module build failed: TypeError: Cannot read property 'includes' of undefined
    at hasVar (/home/max/Development/wearegenkicom/node_modules/postcss-at-rules-variables/lib/index.js:1:478)
    at resolveValue (/home/max/Development/wearegenkicom/node_modules/postcss-at-rules-variables/lib/index.js:1:536)
    at /home/max/Development/wearegenkicom/node_modules/postcss-at-rules-variables/lib/index.js:1:966
    at Array.reduce (<anonymous>)
    at circularReference (/home/max/Development/wearegenkicom/node_modules/postcss-at-rules-variables/lib/index.js:1:905)
    at /home/max/Development/wearegenkicom/node_modules/postcss-at-rules-variables/lib/index.js:1:1387
    at LazyResult.run (/home/max/Development/wearegenkicom/node_modules/postcss/lib/lazy-result.js:277:20)
    at LazyResult.asyncTick (/home/max/Development/wearegenkicom/node_modules/postcss/lib/lazy-result.js:192:32)
    at /home/max/Development/wearegenkicom/node_modules/postcss/lib/lazy-result.js:197:27
    at <anonymous>

 @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-0818d96d","scoped":false,"hasInlineConfig":false}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/views/ViewHomepage.vue 4:14-382 13:3-17:5 14:22-390
 @ ./src/views/ViewHomepage.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?https://localhost:4435 webpack/hot/dev-server ./src/main.js

...
@Scrum Scrum added the type: bug Something isn't working label Jan 19, 2018
@Scrum Scrum added this to the 0.3.3 milestone Jan 19, 2018
@Scrum Scrum self-assigned this Jan 19, 2018
@Scrum Scrum modified the milestones: 0.3.3, 0.1.4 Jan 19, 2018
@maxmilton
Copy link

@gitscrum , I've put together a minimal reproduction repo at https://github.com/MaxMilton/reproduce-postcssatrulesvars-bug.

I done some playing around and I think the culprit behind this bug is variables which are commented out. Sounds a bit strange, I know, but clone my repo and try running it with and without the comment in the CSS.

@maxmilton
Copy link

Upon more testing I've found it happen whenever there's a comment on the line, it doesn't matter if the variable itself is commented or if there's a trailing comment, both result in the error.

Example:

:root {
  /* --variable: true; */
}
:root {
  --variable: true; /* comment */
}

@Scrum
Copy link
Owner Author

Scrum commented Jan 21, 2018

@maxmilton Thanks for your research, they help me to look in the right direction. I will try to understand this quickly.

Scrum added a commit that referenced this issue Jan 22, 2018
Scrum added a commit that referenced this issue Jan 22, 2018
Scrum added a commit that referenced this issue Jan 22, 2018
@Scrum
Copy link
Owner Author

Scrum commented Jan 22, 2018

@maxmilton Thank you for this bug. All is fixed. We will wait for you from new bugs / offers / pool of requests :)

Please do not forget to put the star projects that you like))

@Scrum Scrum closed this as completed Jan 22, 2018
@maxmilton
Copy link

maxmilton commented Jan 23, 2018

Nice! Thank you. Tested and it's now working as expected 🌟 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants