Bug#1009245: ruby-autoprefixer-rails: broken build (TypeError: Cannot read property 'env' of undefined)
On 03/05/2022 15:46, Pirate Praveen wrote: On Tue, 12 Apr 2022 23:59:16 +0530 Akshay S Dinesh wrote: > There is a possibility that this is related to the execjs version. > > https://github.com/ai/autoprefixer-rails/issues/203#issuecomment-838512342 > > > On the other hand, the autoprefixer.js from the gem (about 1 MB) and the > autoprefixer.js that's generated through build from the upstream repo > (about 8 MB) seems to be different. This is unexplained by the dev. > > I think one of the build dependency with major version difference is causing the broken build. "@rollup/plugin-commonjs": "^17.0.0", vs 21.0.1+repack-1 "@rollup/plugin-node-resolve": "^11.0.1", vs 13.2.1+ds-1 "@rollup/plugin-replace": "^2.3.3", vs 3.0.0+ds+~2.2.0-1 We should try the upstream build with these newer versions and see if the error can be reproduced. I enabled test (uvu), passed. So JS part seems not broken. The error "Cannot read property 'env' of undefined" seems related to this line (generated vendor/autoprefixer.js): > if (process.env.NODE_DEBUG) { So I don't understand what is wrong here It seems to have no test for ruby part: > Run tests for ruby3.0: no test suite! Maybe we can do something here ? "spec" directory seems related to ruby test
Bug#1009245: ruby-autoprefixer-rails: broken build (TypeError: Cannot read property 'env' of undefined)
On the other hand, the autoprefixer.js from the gem (about 1 MB) and the autoprefixer.js that's generated through build from the upstream repo (about 8 MB) seems to be different. This is unexplained by the dev. I was comparing an older version of the gem actually. Please ignore this comment. On the other hand, I have found that the node-resolve is somehow resolving util.js from the system (/usr/share/nodejs) instead of node_modules (possibly related to the patch we're applying) and that causes process.env to be read directly (without handling it as if it is inside browser)
Bug#1009245: ruby-autoprefixer-rails: broken build (TypeError: Cannot read property 'env' of undefined)
There is a possibility that this is related to the execjs version. https://github.com/ai/autoprefixer-rails/issues/203#issuecomment-838512342 On the other hand, the autoprefixer.js from the gem (about 1 MB) and the autoprefixer.js that's generated through build from the upstream repo (about 8 MB) seems to be different. This is unexplained by the dev.