question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Force browser environment?

See original GitHub issue

Why is this feature valuable to you? Does it solve a problem you’re having? I’d like to force the Dropbox SDK to use the browser version. I’m developing a plugin for Obsidian that needs this, it runs in a browser environment, but the plugins are usually written in Node. Dropbox detects that I am running a node environment, and so it tries to require('node-fetch'), which breaks the plugin for the mobile version of the app.

Describe the solution you’d like A way to force the SDK to think it is in the browser environment.

Describe alternatives you’ve considered Hacking into the isBrowserEnv function?

Additional context This is the app the plugin is built for: https://obsidian.md/

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ryanpcmcquencommented, Aug 19, 2021

I run this: https://github.com/ryanpcmcquen/obsidian-dropbox-backups/blob/master/upgrade-assets.sh Specifically, this line:

curl "https://cdn.skypack.dev$(curl https://cdn.skypack.dev/dropbox | grep -o '/-/dropbox.*dropbox.js' | tail -1)" -o assets/Dropbox-sdk.js
0reactions
adityabhaskarcommented, Aug 19, 2021

@ryanpcmcquen Do you have a link for the Skypack version? The one I found on the site still had all the checks for isBrowserEnv and references to require('node-fetch').

Read more comments on GitHub >

github_iconTop Results From Across the Web

html - Force browser to clear cache - Stack Overflow
One method is to send the appropriate headers when delivering content to force the browser to reload: Making sure a web page is...
Read more >
How To Force The Browser To Reload Cached .JS, .CSS Files ...
When the user accesses the URL, it will take the cached .js and .css files. That is the reason those new changes will...
Read more >
Environment Variables in Apache
There are two kinds of environment variables that affect the Apache HTTP Server. First, there are the environment variables controlled by the underlying ......
Read more >
Is it actually possible to force a specific browser to be default ...
We have a customer with a 2012 R2 RDS environment. They want their default browser for all users to be Google Chrome.
Read more >
Platform and environment | TensorFlow.js
TensorFlow.js works in the browser and Node.js, and in both ... The environment is comprised of a single global backend as well as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found