-
-
Notifications
You must be signed in to change notification settings - Fork 903
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
[BUG] crypto.getRandomValues() not supported ember.js w/fastboot.js #672
Comments
Recipe is not sufficient to reproduce the problem. $ npm install ember-cli
# etc ...
$ ember s
No ember-cli-build.js found. Note: |
@broofa the real issue is that the app is running fastboot.js which is for server-side render and uses node.js, where crypto lib lacks the window.crypto.getRandomValues(). I found this https://stackoverflow.com/questions/25725596/use-window-crypto-in-nodejs-code Could it be possible to set the rng to use webcrypto w/node? https://stackoverflow.com/a/66692815 |
Is it possible you have your project misconfigured to bundle code for the browser rather than for node? Without a test case demonstrating an actual error, this isn't something we're going to spend time investigating. |
This is definitely a problem with the bundler configuration: Before version 9 we did not ship a CommonJS browser build. This was changed in #642 for better Jest/JSdom compatibility. It is known to be a breaking change since some bundler configurations that may have picked the Node.js CommonJS build as a fallback before may now instead pick the CommonJS browser build. To solve this issue, make sure your bundler picks the right build from the exports: Lines 25 to 37 in 62ef29e
In webpack, these kinds of issues often happen due to bad |
Before you begin...
Description of the problem
Just upgraded to latest 9.0.0 and getting this error. Saw a few closed issues that pertain to react-native.
How can I resolve this in an ember.js project?
Error: crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported
at rng (webpack://ember_auto_import/./node_modules/uuid/dist/commonjs-browser/rng.js?:6:133)
at v4 (webpack://ember_auto_import/./node_modules/uuid/dist/commonjs-browser/v4.js?:1:727)
Recipe for reproducing
install latest, run ember-cli dev server "ember s"
Additional information
n/a
Environment
npx envinfo --system --browsers --npmPackages --binaries
npx: installed 1 in 1.628s
System:
OS: macOS 11.6.8
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Memory: 1.21 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.21.2 - ~/.nvm/versions/node/v14.21.2/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.19.3 - ~/Projects/sqwok/ember-sqwok/node_modules/.bin/npm
Browsers:
Chrome: 108.0.5359.124
Firefox: 108.0.1
Safari: 15.6.1
npmPackages:
@babel/eslint-parser: 7.19.1 => 7.19.1
@babel/plugin-proposal-decorators: 7.20.7 => 7.20.7
@ember/optional-features: 2.0.0 => 2.0.0
@ember/render-modifiers: 2.0.4 => 2.0.4
@ember/test-helpers: 2.9.3 => 2.9.3
@faker-js/faker: ^7.6.0 => 7.6.0
@fortawesome/ember-fontawesome: 0.4.1 => 0.4.1
@fortawesome/pro-regular-svg-icons: 5.12.1 => 5.12.1
@fortawesome/pro-solid-svg-icons: 6.1.1 => 6.1.1
@glimmer/component: 1.1.2 => 1.1.2
@glimmer/tracking: 1.1.2 => 1.1.2
async-mqtt: 2.6.3 => 2.6.3
babel-plugin-transform-remove-console: 6.9.4 => 6.9.4
broccoli-asset-rev: 3.0.0 => 3.0.0
croppr: 2.3.1 => 2.3.1
dayjs: 1.11.7 => 1.11.7
ember-auto-import: 2.4.0 => 2.4.0
ember-basic-dropdown: 6.0.1 => 6.0.1
ember-changeset: 4.1.2 => 4.1.2
ember-changeset-validations: 4.1.1 => 4.1.1
ember-cli: ~4.7.0 => 4.7.0
ember-cli-app-version: 5.0.0 => 5.0.0
ember-cli-babel: 7.26.11 => 7.26.11
ember-cli-fastboot: 4.1.0 => 4.1.0
ember-cli-head: 2.0.0 => 2.0.0
ember-cli-htmlbars: 6.1.1 => 6.1.1
ember-cli-inject-live-reload: 2.1.0 => 2.1.0
ember-cli-mirage: 2.4.0 => 2.4.0
ember-cli-qunit-parameterize: 2.0.0 => 2.0.0
ember-cli-sass: 10.0.0 => 10.0.0
ember-cli-sri: 2.1.1 => 2.1.1
ember-cli-terser: 4.0.2 => 4.0.2
ember-component-css: 0.7.4 => 0.7.4
ember-concurrency: 2.3.7 => 2.3.7
ember-data: ~4.7.0 => 4.7.3
ember-exam: 8.0.0 => 8.0.0
ember-fetch: 8.1.2 => 8.1.2
ember-href-to: 5.0.0 => 5.0.0
ember-in-viewport: 4.1.0 => 4.1.0
ember-load-initializers: 2.1.2 => 2.1.2
ember-modifier: 4.0.0 => 4.0.0
ember-page-title: 7.0.0 => 7.0.0
ember-qunit: 6.1.1 => 6.1.1
ember-resolver: 9.0.1 => 9.0.1
ember-responsive: 5.0.0 => 5.0.0
ember-simple-auth: 4.2.2 => 4.2.2
ember-simple-auth-token: 5.3.1 => 5.3.1
ember-sinon-qunit: 6.0.0 => 6.0.0
ember-source: ~4.7.0 => 4.7.1
ember-template-lint: 5.3.0 => 5.3.0
ember-test-selectors: 6.0.0 => 6.0.0
eslint: 8.11.0 => 8.11.0
eslint-config-airbnb-base: 15.0.0 => 15.0.0
eslint-plugin-compat: 4.0.2 => 4.0.2
eslint-plugin-ember: 10.5.9 => 10.5.9
eslint-plugin-import: 2.25.4 => 2.25.4
eslint-plugin-node: 11.1.0 => 11.1.0
eslint-plugin-qunit: 7.2.0 => 7.2.0
faker: 6.6.6 => 6.6.6
loader.js: 4.7.0 => 4.7.0
qunit: 2.19.3 => 2.19.3
qunit-dom: 2.0.0 => 2.0.0
sass: 1.49.9 => 1.49.9
uuid: 8.3.2 => 8.3.2
webpack: 5.75.0 => 5.75.0
The text was updated successfully, but these errors were encountered: