-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer removed, it cause some trouble #10
Comments
https://github.com/feross/buffer is for example a solution for the browser but it depends on the library that you use. This is not a really a problem with webpack itself imo. |
Buffer in general is not part of the browser APIs and only a NodeJS API. |
Regarding the If this does not work try importing directly https://unpkg.com/browse/[email protected]/dist/es/browser.js |
@DanielRuf I tried resolve alias field and it didn't work for Buffer. ( it worked for others like crypto, process etc) |
You will also need this, to auto-import new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}) |
Thanks @sebinsua Is the feature not yet built? |
We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined
We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined
We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined
We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined
We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined
We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined
We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined
We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined
BYRON keypaths are automatically added with the first account to discover BYRON addresses. This works for all current CryptoProviders (Software, Ledger, Trezor). The BitBox02 does not support receiving on legacy Byron addresses and exporting m/44'/... xpubs, so we need a feature flag to indicate that Byron should be turned off when a BitBox02 is used as the CryptoProvider. add BitBox02 hardware wallet support Co-authored-by: thisconnect <[email protected]> bitbox02: display pairing code bitbox02: add types for the bitbox02-api dependency They will eventually be upstreamed. Excluded from eslint because eslint expects Javascript, not pure Typescript (e.g. it can't parse the constructor type without a body). bitbox02: close an existing connection before opening a new one Same as with getLedgerTransport in the Ledger crypto provider. This ensures logout followed by another login works. upgrade from webpack 4 to webpack 5 We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined bitbox02: lazily load bitbox02-api and split code out of main bundle Since the bitbox02-api package is quite heavy, we only want to load it when actually unlocking a BitBox02. We follow the third approach described in https://webpack.js.org/guides/code-splitting: using `await import(...)` to load the package on demand, which also automatically splits the code into a new file. The `webpackChunkName: "bitbox02-api"` describes the name of the new file in dist/js/. The tsconfig change was needed for code splitting to kick in, according to: - webpack/webpack#5703 (comment) - webpack/webpack#5703 (comment) poolOwner: restrict to Trezor/Ledger
CryptoProviderFeature: add BYRON so new wallets can disable support BYRON keypaths are automatically added with the first account to discover BYRON addresses. This works for all current CryptoProviders (Software, Ledger, Trezor). The BitBox02 does not support receiving on legacy Byron addresses and exporting m/44'/... xpubs, so we need a feature flag to indicate that Byron should be turned off when a BitBox02 is used as the CryptoProvider. add BitBox02 hardware wallet support Co-authored-by: thisconnect <[email protected]> bitbox02: display pairing code bitbox02: add types for the bitbox02-api dependency They will eventually be upstreamed. Excluded from eslint because eslint expects Javascript, not pure Typescript (e.g. it can't parse the constructor type without a body). bitbox02: close an existing connection before opening a new one Same as with getLedgerTransport in the Ledger crypto provider. This ensures logout followed by another login works. upgrade from webpack 4 to webpack 5 We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined bitbox02: lazily load bitbox02-api and split code out of main bundle Since the bitbox02-api package is quite heavy, we only want to load it when actually unlocking a BitBox02. We follow the third approach described in https://webpack.js.org/guides/code-splitting: using `await import(...)` to load the package on demand, which also automatically splits the code into a new file. The `webpackChunkName: "bitbox02-api"` describes the name of the new file in dist/js/. The tsconfig change was needed for code splitting to kick in, according to: - webpack/webpack#5703 (comment) - webpack/webpack#5703 (comment) poolOwner: restrict to Trezor/Ledger
CryptoProviderFeature: add BYRON so new wallets can disable support BYRON keypaths are automatically added with the first account to discover BYRON addresses. This works for all current CryptoProviders (Software, Ledger, Trezor). The BitBox02 does not support receiving on legacy Byron addresses and exporting m/44'/... xpubs, so we need a feature flag to indicate that Byron should be turned off when a BitBox02 is used as the CryptoProvider. add BitBox02 hardware wallet support Co-authored-by: thisconnect <[email protected]> bitbox02: display pairing code bitbox02: add types for the bitbox02-api dependency They will eventually be upstreamed. Excluded from eslint because eslint expects Javascript, not pure Typescript (e.g. it can't parse the constructor type without a body). bitbox02: close an existing connection before opening a new one Same as with getLedgerTransport in the Ledger crypto provider. This ensures logout followed by another login works. upgrade from webpack 4 to webpack 5 We want to dynamically import the bitbox02-api package and split it out of the main bundle. After many different attempts we only found that it works when upgrading to webpack 5, hence this commit. The upgrade was performed by following https://webpack.js.org/migrate/5/. The `require.resolve('...`) additions were upgrade fixes suggested by webpack itself on the command line. Other references used: webpack/changelog-v5#10 (comment) https://stackoverflow.com/questions/41359504/webpack-bundle-js-uncaught-referenceerror-process-is-not-defined bitbox02: lazily load bitbox02-api and split code out of main bundle Since the bitbox02-api package is quite heavy, we only want to load it when actually unlocking a BitBox02. We follow the third approach described in https://webpack.js.org/guides/code-splitting: using `await import(...)` to load the package on demand, which also automatically splits the code into a new file. The `webpackChunkName: "bitbox02-api"` describes the name of the new file in dist/js/. The tsconfig change was needed for code splitting to kick in, according to: - webpack/webpack#5703 (comment) - webpack/webpack#5703 (comment) poolOwner: restrict to Trezor/Ledger
Fix (tests): Fixed the reference error `Buffer is not defined`. Read more: webpack/changelog-v5#10.
Hello.
I use
twing-loader
based ontwing
but this lib is based onBuffer
and it is incompatible with webpack 5.Ironically in my case we don’t need Buffer in the front bundle beacause Twing-loader is only a template loader chained with html-loader and htmlWebpackPlugin, so
Buffer
is not used in the browser (only for dev mode).You recommand to use
browser
entry in package.json https://github.com/defunctzombie/package-browser-field-spec#specAnd you mention a way to add a polyfill manualy:
I try to run my webpack mut I have an error
ReferenceError: Buffer is not defined
without message to explain how to manually add a polyfill.So:
browser
entry intwing
package.json
with aBuffer
polyfill is the best way to fix it ?The text was updated successfully, but these errors were encountered: