I can run my project and build locally without seeing a single error, however when deploying to Netlify, I am seeing this error in their console:
`info bootstrap finished - 2.826 s
1:21:11 PM:
1:21:11 PM: error Generating CSS failed
1:21:11 PM:
TypeError: Cannot read property 'stats' of undefined
index.js:68
[repo]/[caniuse-api]/dist/index.js:68:16
Array.every
index.js:67 isSupported
[repo]/[caniuse-api]/dist/index.js:67:6
index.js:69
[repo]/[postcss-cssnext]/lib/index.js:69:117
Array.forEach
index.js:56
[repo]/[postcss-cssnext]/lib/index.js:56:35
postcss.js:150 creator
[repo]/[postcss]/lib/postcss.js:150:35
webpack.config.js:182 module
[repo]/[gatsby]/dist/utils/webpack.config.js:182:86
webpack.config.js:533 _callee$
[repo]/[gatsby]/dist/utils/webpack.config.js:533:13
1:21:12 PM: Build complete: exit code: 1`
Anyone seen this at all? What is the cause?
I haven't seen that particular issue before but I have some suggestions for debugging which may help you.
The first thing to do is make sure that your local build and Netlify's build have the same inputs:
yarn.lock or package-lock.json file. Yarn and NPM use these files to make the builds identical.node_modules (but not the lockfile) and install again. Now try building again locally and see if you get the error.rm -Rf .cache in your project root) and try building again.Some other things to try:
node_modules/caniuse-api/dist/index.js, go to line 68, and see if you figure out what's going on. That might give you some clues for what might be causing the problem.I hope that helps! Don't forget to comment back with what worked so other people can find your solution. 馃槃
Thanks @whmountains
Pushed the lot up and this time it built fine. So thanks for your help here. I have since deployed a small change and it's behaving still
Most helpful comment
I haven't seen that particular issue before but I have some suggestions for debugging which may help you.
The first thing to do is make sure that your local build and Netlify's build have the same inputs:
yarn.lockorpackage-lock.jsonfile. Yarn and NPM use these files to make the builds identical.node_modules(but not the lockfile) and install again. Now try building again locally and see if you get the error.rm -Rf .cachein your project root) and try building again.Some other things to try:
node_modules/caniuse-api/dist/index.js, go to line 68, and see if you figure out what's going on. That might give you some clues for what might be causing the problem.I hope that helps! Don't forget to comment back with what worked so other people can find your solution. 馃槃