statebox/purescript-studio

tx-browser: Parcel breaks tx-browser Netlify deploy

epost opened this issue · 0 comments

epost commented

In #344, I found that parcel was causing the Netlify builds to fail, seemingly due to tx-browser/html/index.css referencing css and svg files in ../../studio/html. The build error was:

1:14:48 PM: 🚨  /opt/build/repo/halogen-grid-kit/src/GridKit/KeyHandler.css:undefined:undefined: Cannot find module 'cssnano' from '/opt/build/repo/halogen-grid-kit/src/GridKit'
1:14:48 PM:     at /opt/build/repo/tx-browser/node_modules/resolve/lib/async.js:107:35
1:14:48 PM:     at processDirs (/opt/build/repo/tx-browser/node_modules/resolve/lib/async.js:260:39)
1:14:48 PM:     at isdir (/opt/build/repo/tx-browser/node_modules/resolve/lib/async.js:267:32)
1:14:48 PM:     at /opt/build/repo/tx-browser/node_modules/resolve/lib/async.js:23:69
1:14:48 PM:     at FSReqWrap.oncomplete (fs.js:153:21)

The files are referenced here:

Some builds in which this failed:

A workaround was to copy the files into the tx-browser/html dir, rather than referencing them in ../../studio/html. Therefore, the referencing was reverted here:

This seems to be related to Parcel issue #2881.

However, this isn't really what we want.

Reproduction steps

If you are going to be testing this, it would probably be better to configure the tx-browser site such that it wouldn't just be triggered by deploys to development, but also by commits to PR branches.

To try

  • Use Rollup? Rollup is for js only, you can't point it to an html file like parcel.
    • Cat css files and pipe through PostCSS
  • Use Parcel 2.0.0-alpha? Can't get it to work