I'm trying to load PhpWeb in NextJS app, but it's failing as below:
Unhandled Runtime Error
RuntimeError: abort(RuntimeError: abort(both async and sync fetching of the wasm failed). Build with -s ASSERTIONS=1 for more info.). Build with -s ASSERTIONS=1 for more info.
Call Stack
abort
node_modules/php-wasm/php-web.js (9:11689)
eval
node_modules/php-wasm/php-web.js (9:13352)
Version: php-wasm@0.0.4-b
I'm loading <Drupal/> component by:
const Drupal = dynamic(() => import("../components/Drupal"), {ssr: false});
where Drupal class is defined as:
export default class Drupal extends React.Component {
constructor(props) {
super(props);
}
componentDidUpdate(prevProps, prevState) {
}
async componentDidMount() {
const PhpWeb = (await import('php-wasm/PhpWeb')).PhpWeb;
const php = new PhpWeb;
}
render() {
return (
<div className={styles.drupal}>
Drupal
</div>
)
}
}
Any ideas why this error happens? In php-web.js file?