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:
- (https://github.com/statebox/purescript-studio/pull/346/files#diff-2b91eab53cc50180839a81a1c9e9c7baR5-R10)
- https://github.com/statebox/purescript-studio/pull/346/files#diff-2b91eab53cc50180839a81a1c9e9c7baR29
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
- Push a change to
tx-browser
to `development and wait for its deploy to finish: https://app.netlify.com/sites/dazzling-albattani-1c9272/deploys. NB: This is not the same thing as the studio Netlify site. - When the deploy is finished, visit it here: https://browse.statebox.cloud, aka https://dazzling-albattani-1c9272.netlify.com.
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