You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should load balena-sdk on the browser using NuxtJS.
Actual Behavior
Get compilation error:
ERROR Failed to compile with 2 errors
This dependency was not found:
* fs in ./node_modules/balena-settings-client/build/settings.js, ./node_modules/balena-settings-storage/build/node-storage.js
To install it, you can run: npm install --save fs
Hi,
Thanks for raising this. It is indeed an issue with how module bundlers analyze the sources and take into account even branches that never run in browsers.
The simplest workaround is to use the pre-bundled balena-sdk, which you can find in ~/es2015/balena-browser.min.js (or even use a CDN like https://unpkg.com/[email protected]/es2015/balena-browser.min.js).
In case you prefer using ES6 module imports, a more involved fix for this is to edit your nuxt.config.js like:
Expected Behavior
Should load
balena-sdk
on the browser using NuxtJS.Actual Behavior
Get compilation error:
Steps to Reproduce the Problem
npm i -S balena-sdk
pages/index.vue
:Specifications
The text was updated successfully, but these errors were encountered: