Closed jq170727 closed 1 year ago
Another work around is to add this to the static/index.html
:
<!doctype html>
<html lang="en">
<head>
<script>
if (typeof __exports == "undefined") { __exports = {}; }
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="./favicon.ico">
<link rel="stylesheet" href="./styles.scss">
<title>Yew App</title>
</head>
<body>
<script src="./index.ts"></script>
</body>
</html>
upgrade to use trunk, npx create-yew-app@0.2.0 my-app
After creating a new app and starting it with
The window appears black and the browser console reports this error static.77de5100.js:116 Uncaught ReferenceError: __exports is not defined at parcelRequire.../node_modules/parcel-plugin-wasm.rs/wasm-loader.js.fs (wasm-loader.js:2:1) at newRequire (static.77de5100.js:47:24) at localRequire (static.77de5100.js:53:14) at parcelRequire.0 (wasm-loader.js:1140:1) at newRequire (static.77de5100.js:47:24) at static.77de5100.js:81:7 at static.77de5100.js:120:3
wasm-loader.js isn't part of parcel-plugin-wasm.rs. It seems to be generated. Looking at
node_modules/parcel-plugin-wasm.rs/wasm-loader.js
showsManually prepending the following line to the file at the top works around the problem