The gulp plugin crashed on Netlify

Everything worked fine when I converted the font format locally using “gulp-ttf2woff2”(NPM), but it failed when I uploaded it to Netlify.

This is the log: Ubuntu Pastebin

I’m not sure if this is a plugin problem or netlify’s problem, but if there are other ways to automatically convert fonts, please let me know.

hi there, looks like this is indeed the culprit:

8:01:54 PM: [12:01:54] Finished 'convert' after 22 ms
8:01:58 PM: node:events:368
8:01:58 PM:       throw er; // Unhandled 'error' event
8:01:58 PM:       ^
8:01:58 PM: PluginError: Could not convert the given font.
8:01:58 PM:     at Transform.ttf2woff2GulpTransform [as _transform] (/opt/build/repo/node_modules/gulp-ttf2woff2/src/index.js:77:25)

can you share your package.json? i wonder if you have some outdated packages that upgrading might fix this.

This is the source code of my website: GitHub - EmptyDreams/blog: 空梦的博客

Hey @EmptyDreams

Based on the following lines, the build is a production build (as opposed to a development build)

8:00:45 PM: ❯ Context
8:00:45 PM:   production

This means as mentioned in this documentation that anything listed under devDependencies are not installed. As gulp-ttf2woff2 and other gulp plugins are listed as devDependencies they aren’t available. Can you move these from devDependencies to dependencies and try building again.

Except for “gulp-ttf2woff2”, all other gulp plugins work fine.

Hi @EmptyDreams,

I can see you’ve already opened an issue on the Gulp plugin repo. Not sure if the dev would reply there, but the error message in your build log doesn’t mention any kind of error description as to which font failed, and why it failed. So, we’re at a loss to explain what could be happening.

What we can suggest is to use something else like this:

to see if it works.


@coelmay

About the above, every production build on Netlify will have the production context. Production context on Netlify doesn’t mean the NODE_ENV is set to production. We set it to development on all builds regardless of the context, so in most cases, devDependencies should also be installed.

1 Like

Thanks @hrishikesh. I did realise this some time after I posted by comment above.