I got this error and it comes from @rollup/plugin-node-resolve
[!] TypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
//...
at async Promise.all (index 0)
at async Promise.all (index 2)
at async Promise.all (index 0)
at async Promise.all (index 0)
at async Promise.all (index 0)
This is my config. I can confirm the error is coming from @rollup/plugin-node-resolve
const config = {
input: './build/sw.js',
//Other configs
}],
plugins: [
nodeResolve(),
commonjs({
include: ['./src/**', 'node_modules/**']
})
]
}
I am importing the following workbox dependency in my sw.js
workbox-core
workbox-precaching
workbox-routing
workbox-strategies
workbox-expiration
workbox-background-sync
How can I tackle this error?