Snowpack: install error: `process.cwd is not a function`

Created on 25 Aug 2020  路  4Comments  路  Source: snowpackjs/snowpack

From https://github.com/pikapkg/snowpack/discussions/911
/cc @benoitg

This is a good followup for #854 - how far do we go in polyfilling process? We should just take the snippet that we return in https://github.com/pikapkg/snowpack/edit/master/snowpack/src/rollup-plugins/rollup-plugin-node-process-polyfill.ts & replace it with the Rollup polyfill in its entirety (https://github.com/ionic-team/rollup-plugin-node-polyfills/blob/master/polyfills/process-es6.js) so that we keep parity and also don't have to keep addressing one offs like this one.

Pseudo code

const polyfillPath = require.resolve('rollup-plugin-node-polyfills/polyfills/process-es6.js');
const polyfillCode = fs.readFileSync(polyfillPath, 'utf-8');
...
return `/* SNOWPACK POLYFILL - process */\n${polyfillCode}`;

Testing

Will be covered by existing snapshot tests.

help wanted

Most helpful comment

@MoonBall I just tested 2.9.3. I can confirm this issue is fixed by #920

All 4 comments

I would like to try it

Awesome! @MoonBall Thanks so much for jumping into these issues and helping out with PRs this last week, I really appreciate it!

PS: Do you have a Twitter? I gave you a shout out last weekend on Twitter for your contributions to the 2.9 release, but with your GH username: https://twitter.com/pikapkg/status/1297616824960352256

Thanks for your praise. Let's make snowpack better.

PS: Do you have a Twitter?

My Twitter is @MoonBall_cxy.

@MoonBall I just tested 2.9.3. I can confirm this issue is fixed by #920

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FredKSchott picture FredKSchott  路  6Comments

daniele-orlando picture daniele-orlando  路  6Comments

drwpow picture drwpow  路  3Comments

devongovett picture devongovett  路  4Comments

FredKSchott picture FredKSchott  路  6Comments