boa icon indicating copy to clipboard operation
boa copied to clipboard

Import is not working

Open eramax opened this issue 3 years ago • 2 comments

Describe the bug I would like to run react app using boa engine, first I tried to import a package like d3 and found there is an bug, may be the import feature is not ready yet.

To Reproduce

import d3Js from 'https://d3js.org/d3.v3.min.js';

Expected behavior expected to run without an error, and to see the wasm playground loaded through network the d3 package. but I received this error

Uncaught "SyntaxError": "unexpected token 'import', primary expression at line 1, col 1"

Build environment (please complete the following information):

eramax avatar Dec 22 '22 01:12 eramax

Yeah, the module system is a WIP. See https://github.com/boa-dev/boa/pull/2411 for updates.

jedel1043 avatar Dec 22 '22 02:12 jedel1043

This is technically solved by #2922, but the playground won't fetch modules from the web. I'm working on an example on how to asynchronously fetch modules using the new modules API, so we could easily integrate that into our wasm playground.

jedel1043 avatar Jun 07 '23 21:06 jedel1043