yewstack / yew-wasm-pack-minimal Goto Github PK
View Code? Open in Web Editor NEWA minimal template for starting a Yew project using wasm-bindgen and wasm-pack
License: Apache License 2.0
A minimal template for starting a Yew project using wasm-bindgen and wasm-pack
License: Apache License 2.0
Until wasm-pack
RFC #6 is implemented there is no available option to generate a single amalgamated JavaScript file
Hi,
Really like Yew so far, but I keep running into a problem where when I tweak something small in the html!
macro, and then suddenly see nothing in the browser anymore. Typically this has been something like changing <input />
to ` - suddently nothing renders and I get a 'LinkError' in the console.
I struggled to get a good reproducible example until I tried starting from scratch with this repo and I get a similar problem - no "Hello world" displayed in the browser, and in the browser console I get: Uncaught (in promise) LinkError: import object field '__wbindgen_closure_wrapper287' is not a Function
.
Reproduction:
git clone https://github.com/yewstack/yew-wasm-pack-minimal
wasm-pack build --target web
rollup ./main.js --format iife --file ./pkg/bundle.js
python -m http.server 8080
Hi,
I've followed all the instructions and didn't change anything, bit I still get this error:
Encountered a Panic!
Panic error message: attempted to leave type `stdweb::webcore::serialization::SerializedValue` uninitialized, which is invalid
Replace "No description, website, or topics provided." with "A minimal template for starting a Yew project using wasm-bindgen and wasm-pack."
I cloned the repo installed all the things i think are necessary and get the following errors by
wasm-pack build --target web
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
Updating crates.io index
.... omitted downloading and compiling of creates ....
[INFO]: Installing wasm-bindgen...
[INFO]: :-) Done in 53.53s
[INFO]: :-) Your wasm pkg is ready to publish at ./pkg.
then started a webserver in the projects root and the Browser is telling me after loading the index.html
Loading failed for the <script> with source “http://localhost:8080/pkg/bundle.js”.
and in fact under /pkg there is no bundle.js like the index.html
is trying to load
index.html
from the project
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Yew</title>
<script src="/pkg/bundle.js" defer></script>
</head>
<body>
</body>
</html>
ls -la pkg
drwxr-xr-x 3 naikon users 4096 24. Nov 19:42 .
drwxr-xr-x 7 naikon users 4096 24. Nov 19:44 ..
-rw-r--r-- 1 naikon users 1 24. Nov 19:42 .gitignore
-rw-r--r-- 1 naikon users 9723 24. Nov 19:42 LICENSE-APACHE
-rw-r--r-- 1 naikon users 1055 24. Nov 19:42 LICENSE-MIT
-rw-r--r-- 1 naikon users 844 24. Nov 19:42 package.json
-rw-r--r-- 1 naikon users 2016 24. Nov 19:42 README.md
drwxr-xr-x 4 naikon users 4096 24. Nov 19:42 snippets
-rw-r--r-- 1 naikon users 149 24. Nov 19:42 yew_wasm_pack_minimal_bg.d.ts
-rw-r--r-- 1 naikon users 152277 24. Nov 19:42 yew_wasm_pack_minimal_bg.wasm
-rw-r--r-- 1 naikon users 427 24. Nov 19:42 yew_wasm_pack_minimal.d.ts
-rw-r--r-- 1 naikon users 26097 24. Nov 19:42 yew_wasm_pack_minimal.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.