Run a node module from the client-side

Hi all,

We are trying to run a node module from the client-side, is this possible?

As a follow-up, we tried to do this via a plugin action (client-side) but that doesnt allow for modules.

This isn’t a Bubble limitation - the NPM repository is built for node environments, i.e. not for the browser. Modules that do end up client-side are usually aggregated and compiled by Browserify / similar before being hosted. Other modules are built only to run server side and access system modules / APIs that aren’t exposed in browser runtime. I’m just putting that out there as a health warning because it’s not a plug-and-play system.

But some modules will happily run in the browser either out the box or with a small bit of adaptation.

The simplest way to access NPM modules directly into your client-side plugins is to use https://unpkg.com which is a CDN for the full NPM repository.

Useful post from @aaronsheldon here on loading JS resources onto the client.

1 Like

Thanks Edward! If you’re available to hire to help us solve this problem please reach out to us at hello@uproll.app. We are having trouble loading it client-side.

This topic was automatically closed after 70 days. New replies are no longer allowed.