Skip to content
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

Warning on WASM compilation #1824

Closed
Razican opened this issue Feb 6, 2022 · 2 comments
Closed

Warning on WASM compilation #1824

Razican opened this issue Feb 6, 2022 · 2 comments
Labels
bug Something isn't working webassembly Anything related to using Boa with WASM
Milestone

Comments

@Razican
Copy link
Member

Razican commented Feb 6, 2022

Describe the bug
When building Boa for having a WASM playground, a warning gets emitted:

$ yarn build --stats-error-details
yarn run v1.22.17
$ webpack --stats-error-details
🧐  Checking for wasm-pack...

✅  wasm-pack is installed at /opt/homebrew/bin/wasm-pack. 

ℹ️  Compiling your crate in release mode...

[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
    Finished release [optimized] target(s) in 0.03s
[WARN]: ⚠️   origin crate has no README
[INFO]: License key is set in Cargo.toml but no LICENSE file(s) were found; Please add the LICENSE file(s) to your project directory
[INFO]: ⬇️  Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: ✨   Done in 8.19s
[INFO]: 📦   Your wasm pkg is ready to publish at ./boa_wasm/pkg.
✅  Your crate has been correctly compiled

assets by path *.js 24 MiB
  assets by chunk 674 KiB (id hint: vendors)
    asset vendors-node_modules_monaco-editor_esm_vs_language_json_jsonMode_js.js 89.5 KiB [emitted] (id hint: vendors)
    asset vendors-node_modules_monaco-editor_esm_vs_language_html_htmlMode_js.js 73.4 KiB [emitted] (id hint: vendors)
    + 24 assets
  + 62 assets
assets by info 2.74 MiB [immutable]
  asset 72b7eb847ab361ae6fce.module.wasm 2.68 MiB [emitted] [immutable]
  asset f1fd2824f6c602ce2f26120c54953273.ttf 68.1 KiB [emitted] [immutable] [from: node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf] (auxiliary name: app)
  asset 7526c576cd890fcde08f.ttf 80 bytes [emitted] [immutable] [from: node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf] (auxiliary name: app)
assets by path assets/ 569 KiB
  asset assets/01_rust_loves_js.png 274 KiB [emitted] [from: assets/01_rust_loves_js.png] [copied]
  asset assets/bootstrap.min.css 160 KiB [emitted] [from: node_modules/bootstrap/dist/css/bootstrap.min.css] [copied]
  asset assets/logo.svg 135 KiB [emitted] [from: assets/logo.svg] [copied]
asset index.html 1.62 KiB [emitted]
runtime modules 14.9 KiB 35 modules
modules by path ./node_modules/monaco-editor/esm/vs/ 17.3 MiB (javascript) 80 bytes (asset) 885 modules
modules by path ./node_modules/style-loader/dist/runtime/*.js 5.75 KiB 6 modules
modules by path ./boa_wasm/pkg/ 8.19 KiB (javascript) 2.68 MiB (webassembly)
  modules by path ./boa_wasm/pkg/*.js 7.7 KiB 2 modules
  + 2 modules
modules by path ./node_modules/css-loader/dist/runtime/*.js 2.91 KiB
  ./node_modules/css-loader/dist/runtime/noSourceMaps.js 64 bytes [built] [code generated]
  + 2 modules
modules by mime type image/svg+xml 3.17 KiB
  data:image/svg+xml;base64,PHN2ZyB3aWR0aD0i.. 1.59 KiB [built] [code generated]
  data:image/svg+xml;base64,PHN2ZyB3aWR0aD0i.. 1.59 KiB [built] [code generated]
./index.js 1.53 KiB [built] [code generated]
data:image/png;base64,iVBORw0KGgoAAAAN.. 268 bytes [built] [code generated]

WARNING in ./boa_wasm/pkg/index_bg.js 189:14-60
Critical dependency: the request of a dependency is an expression
    at CommonJsRequireContextDependency.getWarnings (./node_modules/webpack/lib/dependencies/ContextDependency.js:91:18)
    at Compilation.reportDependencyErrorsAndWarnings (./node_modules/webpack/lib/Compilation.js:3129:24)
    at ./node_modules/webpack/lib/Compilation.js:2726:28
    at eval (eval at create (./node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:29:1)
    at ./node_modules/webpack/lib/FlagDependencyExportsPlugin.js:385:11
    at ./node_modules/neo-async/async.js:2830:7
    at Object.each (./node_modules/neo-async/async.js:2850:39)
    at ./node_modules/webpack/lib/FlagDependencyExportsPlugin.js:361:18
    at ./node_modules/neo-async/async.js:2830:7
    at Object.each (./node_modules/neo-async/async.js:2850:39)
 @ ./boa_wasm/pkg/index.js 2:0-30 2:0-30
 @ ./index.js 4:13-37

webpack 5.68.0 compiled with 1 warning in 10662 ms
✨  Done in 11.14s.

To Reproduce
In the main branch, run yarn build or yarn serve. You will see the warning displayed.

Expected behavior
No warning appears.

Build environment (please complete the following information):

  • OS: macOS Monterey 12.2
  • Version: 12.2 (M1 Mac)
  • Target triple: wasm32-unknown-unknown
  • Rustc version: rustc 1.58.1 (db9d1b20b 2022-01-20)

Additional context

Using wasm-pack 0.10.2.

@Razican Razican added bug Something isn't working webassembly Anything related to using Boa with WASM labels Feb 6, 2022
Razican added a commit that referenced this issue Feb 6, 2022
This commit selects the production build (instead of development) for
the WebAssembly compilation with Webpack, used in our playground. This
might make things a bit faster and smaller.

I also took the opportunity to update all the dependencies and the Test262
suite, but unfortunately this doesn't solve #1824.
bors bot pushed a commit that referenced this issue Feb 7, 2022
This commit selects the production build (instead of development) for the WebAssembly compilation with Webpack, used in our playground. This might make things a bit faster and smaller.

I also took the opportunity to update all the dependencies and the Test262 suite, but unfortunately this doesn't solve #1824.
@rumpl
Copy link
Contributor

rumpl commented Feb 12, 2022

This warning seems to come from getrandom, but it was supposed to be fixed in 0.2.4.

@rumpl
Copy link
Contributor

rumpl commented Feb 13, 2022

Ok I did some more digging and it looks like the PR I linked did not actually make it to the 0.2.4 version so I guess the best thing to do is wait for the 0.2.5 version and the warning should then go away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working webassembly Anything related to using Boa with WASM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants