second-state / wasmedge-quickjs

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

Error running `react_ssr_stream` example #114

Closed Industrial closed 6 months ago

Industrial commented 10 months 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 10 months ago

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

L-jasmine commented 8 months ago

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