second-state / wasmedge-quickjs

A high-performance, secure, extensible, and OCI-complaint JavaScript runtime for WasmEdge.
Apache License 2.0
498 stars 61 forks source link

Error running `react_ssr_stream` example #114

Closed Industrial closed 9 months ago

Industrial commented 1 year ago

Hi!

I'm running into errors trying to run the react_ssr_stream example. This is with WasmEdge 0.12 on NixOS.

wasmedge-quickjs/example_js/react_ssr_stream on  main [?] via  took 1m45s
❯ nix-shell -p wasmedge nodePackages.pnpm

[nix-shell:~/Code/code9/node/wasmedge-quickjs/example_js/react_ssr_stream]$ pnpm build

> @ build /home/tom/Code/code9/node/wasmedge-quickjs/example_js/react_ssr_stream
> rollup -c rollup.config.js

./main.mjs → dist/main.mjs...
babelHelpers: 'bundled' option was used by default. It is recommended to configure this option explicitly, read more here: https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
http (imported by main.mjs)
stream (imported by stream?commonjs-external)
util (imported by util?commonjs-external)
(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
created dist/main.mjs in 1.3s

[nix-shell:~/Code/code9/node/wasmedge-quickjs/example_js/react_ssr_stream]$ wasmedge --dir .:. ./wasmedge_quickjs_compiled.wasm dist/main.mjs
ReferenceError: could not load module filename 'stream'
hydai commented 1 year ago

Hi @L-jasmine Could you help with this issue?

L-jasmine commented 11 months ago

@Industrial You need to ensure that modules is in the current path ., as QuickJS reads the stream.js file from this directory.