Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Update BWTC.js #5

Merged
merged 1 commit into from
Jun 16, 2022
Merged

Update BWTC.js #5

merged 1 commit into from
Jun 16, 2022

Conversation

elbywan
Copy link
Contributor

@elbywan elbywan commented Jun 15, 2022

Hey @gre 👋

I am trying to replace webpack with vite.js in dev mode for Ledger Live Desktop and I encountered an error while trying it out.

The line BWTC = Object.create(null); instantiates silently a global variable which is not compatible with the Javascript Strict mode which is enabled by default when using Javascript modules in a browser.

I think that prefixing the variable with a simple const should fix without causing any harm to the rest of the code.

The line `BWTC = Object.create(null);` instantiates silently a global variable which is not compatible with [the Javascript Strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode#converting_mistakes_into_errors) which is [enabled by default](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode#strict_mode_for_modules) when using Javascript modules in a browser.

I think that prefixing the variable with a simple `const = ` should fix without causing any harm to the rest of the code.

_For the context, I am trying to replace `webpack` with `vite.js` in dev mode for Ledger Live Desktop which threw the error caused by this global allocation._
@gre gre merged commit d9e8e4d into LedgerHQ:master Jun 16, 2022
@elbywan elbywan deleted the patch-1 branch June 16, 2022 12:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants