question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'toLowerCase' of undefined

See original GitHub issue
  • Laravel Mix Version: 6.0.10 (npm list --depth=0)
  • Node Version (node -v): 14.15.4
  • NPM Version (npm -v): 6.14.11
  • OS: Microsoft Windows [Version 10.0.19042.685]

Description:

Receiving the below error when executing “npm run prod” on a project using the Keen Bootstrap theme.


Console Output

c:\dev\workspace\laravel>npm run prod

@ prod c:\dev\workspace\laravel npm run production

@ production c:\dev\workspace\laravel mix --production

ERROR in ./resources/sass/app.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js): TypeError: Cannot read property ‘toLowerCase’ of undefined at c:\dev\workspace\laravel\resources\sass\app.scss:61517:1 at c:\dev\workspace\laravel\resources\sass\app.scss:61518:3 at hasInherit (c:\dev\workspace\laravel\node_modules\postcss-merge-longhand\dist\lib\canExplode.js:13:39) at exports.default (c:\dev\workspace\laravel\node_modules\postcss-merge-longhand\dist\lib\canExplode.js:22:13) at c:\dev\workspace\laravel\node_modules\postcss-merge-longhand\dist\lib\decl\borders.js:192:39 at c:\dev\workspace\laravel\node_modules\postcss\lib\container.js:98:18 at c:\dev\workspace\laravel\node_modules\postcss\lib\container.js:74:18 at Rule.each (c:\dev\workspace\laravel\node_modules\postcss\lib\container.js:60:16) at Rule.walk (c:\dev\workspace\laravel\node_modules\postcss\lib\container.js:71:17) at Rule.walkDecls (c:\dev\workspace\laravel\node_modules\postcss\lib\container.js:96:19) at Object.explode (c:\dev\workspace\laravel\node_modules\postcss-merge-longhand\dist\lib\decl\borders.js:191:10) at c:\dev\workspace\laravel\node_modules\postcss-merge-longhand\dist\index.js:21:19 at processResult (c:\dev\workspace\laravel\node_modules\webpack\lib\NormalModule.js:597:19) at c:\dev\workspace\laravel\node_modules\webpack\lib\NormalModule.js:691:5 at c:\dev\workspace\laravel\node_modules\loader-runner\lib\LoaderRunner.js:399:11 at c:\dev\workspace\laravel\node_modules\loader-runner\lib\LoaderRunner.js:251:18 at context.callback (c:\dev\workspace\laravel\node_modules\loader-runner\lib\LoaderRunner.js:124:13) at Object.loader (c:\dev\workspace\laravel\node_modules\postcss-loader\dist\index.js:103:7)

The error wasn’t helpful, but I was able to track down the offending code.

// Accent type
&.checkbox-accent {
    > span {
        border-width: get($checkbox-config, types, accent, borderWidth) !important; <-------------------- ERROR SOURCE
        border-style: solid !important;
        background-color: transparent !important;

        &:after {
			display: block;
        }
    }
}

Removing “!important” produced a successful outcome.


Steps To Reproduce:

  1. laravel new laravel

  2. Follow integration guides located at… — https://keenthemes.com/keen/?page=docs&section=html-webpack-quick-starthttps://keenthemes.com/keen/?page=docs&section=laravel-integration
  3. npm install && npm run prod

FYI: Using “!important” is not an issue when used with standard CSS markup.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:10

github_iconTop GitHub Comments

8reactions
jamesparkescommented, Mar 3, 2021

how was this resolved? i do have cssnano as a package in my project, but i’m still receiving this error?

0reactions
Volen99commented, Jan 13, 2022

IDK about you guys, but updating to Angular 13 fixed it for me ♥

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read Property 'toLowerCase' of Null in JS
The "Cannot read Property 'toLowerCase' of null" error occurs when the toLowerCase() method is called on a variable that stores a null value....
Read more >
Uncaught TypeError: Cannot read property 'toLowerCase' of ...
It causes the error when you access $(this).val() when it called by change event this points to the invoker i.e. CourseSelect so it...
Read more >
Cannot read property 'toLowerCase' of undefined (Example)
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined ... toLowerCase(); search = prompt( 'Search for a product in our store.
Read more >
TypeError: Cannot read property 'toLowerCase' of ... - GitHub
js process with a non-zero exit code. (node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toLowerCase' of undefined at ...
Read more >
cannot read properties of undefined (reading 'tolowercase')
The error arises when you want to perform operation on something that does not exists. You seem to be running toLowerCase on some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found