Netlify-cms: Dependency for babel-plugin-inline-svg fails Node >= 12

Created on 27 May 2019  路  6Comments  路  Source: netlify/netlify-cms

Describe the bug

When running yarn using Node 12 on Windows (presumably all OS's) the dependencies fail on gatsby-plugin-inline-svg for sub dep deasync build using node-gyp.

To Reproduce

Upgrade local node version to 12

Expected behavior

Should download and build dependencies without errors

Screenshots

image

Applicable Versions:

  • Netlify CMS version: latest
  • OS: Windows 10
  • Node.JS version: 12.3.1

_Caveat_: The solution here does not solve netlify-cms-site. The website still fails. See https://github.com/netlify/netlify-cms/issues/2358

All 6 comments

Confirmation there was an issue with deasync (fixed 0.1.15):
https://github.com/abbr/deasync/issues/114

Dependency of synchronized-promise: https://github.com/Yukaii/synchronized-promise/blob/master/package.json#L30

synchronized-promise is a dependency of babel-plugin-inline-svg

Ah so that's what's causing it - is there a fix?

~Unfortunately this is a dependency in the website.~

No, there is not a fix for it and would require 2 packages deep to apply the change and update of the dependency. First level in https://github.com/Yukaii/synchronized-promise/issues/6

~Maybe a different package for inline svg would be the way to solve this one.~

https://github.com/Yukaii/synchronized-promise/issues/6 fixed. Now on to babel-plugin-inline-svg

https://github.com/iest/babel-plugin-inline-svg/issues/3

https://github.com/iest/babel-plugin-inline-svg/pull/4

Here are the steps I used to confirm this will solve the issue with Node 12:

  • created a monorepo package called babel-plugin-inline-svg under packages
  • git cloned the iest/babel-plugin-inline-svg repo to the local location packages/babel-plugin-inline-svg
  • changed the version in the new package to 1.1.0
  • changed the dependency of synchronized-promise to 0.1.0
  • changed the version dependency in the package.json at the root of the project to 1.1.0
  • run yarn to update dependencies and bootstrap the local monorepo package
  • run yarn why deasync to make sure we are using the local package
  • run yarn build to make sure everything builds

Everything worked for netlify-cms! 馃帀 So, we can always create a fork of babel-plugin-inline-svg if it does not get fixed in a timely manner.

_Caveat_: This does not solve netlify-cms-site. The website still fails.

Fixing this issue will solve the ability to develop under Node 12 for the monorepo, so I have split the 2 issues (monorepo vs site).

I think since we are building the site in a different build process and can target a lower version of node until it is fixed, these issues can stay separate.

PR issued for [email protected] fix. 馃帀

Was this page helpful?
0 / 5 - 0 ratings