You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the laravel-mix-criticalcss extension on a site I'm working on that uses Mix for the front end and I'm getting the following error in my build process when it tries to run it:
TypeError: criticalSrc.indexOf is not a function
at /node_modules/laravel-mix-criticalcss/index.js:39:33
at Array.forEach ()
at Critical.webpackPlugins (/buddy/investarstage/node_modules/laravel-mix-criticalcss/index.js:34:30)
Here's my code from my mix file:
.criticalCss({
enabled: mix.inProduction(),
paths: {
base: process.env.PRIMARY_SITE_URL,
templates: './css/critical', //Where css files need to be written, all these paths are relative to /public
//So the example path here will be public/css/critical
suffix: '_critical.min'
},
urls: [
{ url: process.env.BASE_URL , template: 'index' },
{ url: process.env.BASE_URL + 'personal-banking', template: 'personal' },
{ url: process.env.BASE_URL + 'small-business-banking', template: 'smallbusiness' },
{ url: process.env.BASE_URL + 'commercial-banking', template: 'commercial' },
{ url: process.env.BASE_URL + 'about-us', template: 'about' },
{ url: process.env.BASE_URL + 'locations', template: 'location' },
],
//Now using https://github.com/addyosmani/critical v4.0.1
options: {
//It's important to note here you should NOT set inline:true, this will break the whole system.
minify: true,
dimensions: [
{
height: 700,
width: 300,
},
{
height: 200,
width: 500,
},
{
height: 1024,
width: 768,
},
{
height: 900,
width: 1024,
},
],
},
})
Can you help me to troubleshoot why this is occurring?
The text was updated successfully, but these errors were encountered:
Hi,
I'm trying to use the laravel-mix-criticalcss extension on a site I'm working on that uses Mix for the front end and I'm getting the following error in my build process when it tries to run it:
TypeError: criticalSrc.indexOf is not a function
at /node_modules/laravel-mix-criticalcss/index.js:39:33
at Array.forEach ()
at Critical.webpackPlugins (/buddy/investarstage/node_modules/laravel-mix-criticalcss/index.js:34:30)
Here's my code from my mix file:
Can you help me to troubleshoot why this is occurring?
The text was updated successfully, but these errors were encountered: