angular-wasm's People
angular-wasm's Issues
Module parse failed /wasm/fibonacci.wasm
i'm get error with angular 12, may be detect with ivy
./node_modules/file-loader/dist/cjs.js?name=wasm/fibonacci.wasm!./wasm/fibonacci.wasm - Error: Module parse failed: magic header not detected
Fibonacci is not a function
Hello Lukas,
I tried the exact same method you've demonstrated on your blog. I get
core.js:19865 ERROR Error: Uncaught (in promise): TypeError: this.module._fibonacci is not a function
TypeError: this.module._fibonacci is not a function
at MapSubscriber.project (wasm.service.ts:53)
at MapSubscriber._next (map.js:29)
at MapSubscriber.next (Subscriber.js:50)
at FilterSubscriber._next (filter.js:33)
at FilterSubscriber.next (Subscriber.js:50)
at BehaviorSubject.next (Subject.js:39)
at BehaviorSubject.next (BehaviorSubject.js:30)
at Object.onRuntimeInitialized (wasm.service.ts:33)
at doRun (fibonacci.js:218)
at run (fibonacci.js:223)
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:21825)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)
I'm using Angular 7.2.0.
Looking forward to hearing from you.
Module not found: Error: Can't resolve 'fs' in '/Users/temp/wasm/angular-wasm/wasm'
Not working in ng 8.
"dependencies": {
"@angular/animations": "^8.0.0-rc.5",
"@angular/common": "^8.0.0-rc.5",
"@angular/compiler": "^8.0.0-rc.5",
"@angular/core": "^8.0.0-rc.5",
"@angular/forms": "^8.0.0-rc.5",
"@angular/platform-browser": "^8.0.0-rc.5",
"@angular/platform-browser-dynamic": "^8.0.0-rc.5",
"@angular/platform-server": "^8.0.0-rc.5",
"@angular/router": "^8.0.0-rc.5",
"core-js": "^2.6.8",
"rxjs": "^6.5.2",
"terser": "^4.0.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.0-rc.4",
"@angular/cli": "^8.0.0-rc.4",
"@angular/compiler-cli": "^8.0.0-rc.5",
"@angular/language-service": "^8.0.0-rc.5",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"@types/webassembly-js-api": "^0.0.1",
"codelyzer": "^5.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.2",
"ts-node": "^8.2.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
}
ERROR in ./wasm/fibonacci.js
Module not found: Error: Can't resolve 'fs' in '/Users/temp/wasm/angular-wasm/wasm'
ERROR in ./wasm/fibonacci.js
Module not found: Error: Can't resolve 'path' in '/Users/temp/wasm/angular-wasm/wasm'
ERROR in ./wasm/fibonacci.wasm (./node_modules/file-loader/dist/cjs.js?name=wasm/fibonacci.wasm!./wasm/fibonacci.wasm)
Module parse failed: magic header not detected
You may need an appropriate loader to handle this file type.
Error: magic header not detected
at new CompileError (/Users/temp/wasm/angular-wasm/node_modules/@webassemblyjs/helper-api-error/lib/index.js:40:109)
at parseModuleHeader (/Users/temp/wasm/angular-wasm/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js:287:13)
at Object.decode (/Users/temp/wasm/angular-wasm/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js:1681:3)
at decode (/Users/temp/wasm/angular-wasm/node_modules/@webassemblyjs/wasm-parser/lib/index.js:248:21)
at WebAssemblyParser.parse (/Users/temp/wasm/angular-wasm/node_modules/webpack/lib/wasm/WebAssemblyParser.js:74:19)
at doBuild.err (/Users/temp/wasm/angular-wasm/node_modules/webpack/lib/NormalModule.js:460:32)
at runLoaders (/Users/temp/wasm/angular-wasm/node_modules/webpack/lib/NormalModule.js:342:12)
at /Users/temp/wasm/angular-wasm/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/temp/wasm/angular-wasm/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/Users/temp/wasm/angular-wasm/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /Users/temp/wasm/angular-wasm/node_modules/loader-runner/lib/LoaderRunner.js:236:3
at runSyncOrAsync (/Users/temp/wasm/angular-wasm/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
at iterateNormalLoaders (/Users/temp/wasm/angular-wasm/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
at /Users/temp/wasm/angular-wasm/node_modules/loader-runner/lib/LoaderRunner.js:205:4
at VirtualFileSystemDecorator.readFile (/Users/temp/wasm/angular-wasm/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:42:13)
at processResource (/Users/temp/wasm/angular-wasm/node_modules/loader-runner/lib/LoaderRunner.js:202:11)
ERROR in ./wasm/fibonacci.wasm (./node_modules/file-loader/dist/cjs.js?name=wasm/fibonacci.wasm!./wasm/fibonacci.wasm)
WebAssembly module is included in initial chunk.
This is not allowed, because WebAssembly download and compilation must happen asynchronous.
Add an async splitpoint (i. e. import()) somewhere between your entrypoint and the WebAssembly module:
* multi (webpack)-dev-server/client?http://0.0.0.0:0/sockjs-node ./src/main.ts --> ./src/main.ts --> ./src/app/app.module.ts --> ./src/app/wasm.service.ts --> ./node_modules/file-loader/dist/cjs.js?name=wasm/fibonacci.wasm!./wasm/fibonacci.wasm
* ... --> ./src/app/app.module.ts --> ./src/app/app.component.ts --> ./src/app/wasm.service.ts --> ./node_modules/file-loader/dist/cjs.js?name=wasm/fibonacci.wasm!./wasm/fibonacci.wasm
ERROR in chunk main [initial]
0a82e76cb3c2448ef8ce.module.wasm
/Users/temp/wasm/angular-wasm/node_modules/file-loader/dist/cjs.js?name=wasm/fibonacci.wasm!/Users/temp/wasm/angular-wasm/wasm/fibonacci.wasm
unexpected end
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.