Open ndabAP opened 5 years ago
workly is essentially two functions expose and proxy, so depending on which ones you want to use you import those.
import {proxy, expose} from 'workly'
I should update the docs with this
Thanks for your feedback. Also tried that and it gave me undefined
.
Ok i'll take a look later today. Probably something I overlooked.
Thanks :) Using Webpack (actually Vue.js but it uses Webpack).
I'm so sorry. I never got back to you on this. Please let me know if you're still using workly
Actually no, but the problem is likely not gone ;)
Thanks. It has something to do with es6 modules in a Webpack that is not configured for that. I have not used web pack much but will try setting up a Vue project with it
I am experiencing this, currently.
I created a CodeSandbox to demonstrate the issue. :)
Same issue here, getting empty object when doing import * as workly from "workly"
.
Also tried
import { proxy, expose } from 'workly';
[ERROR] Cannot find name 'proxy'. Did you mean 'Proxy'?
Cannot find name 'expose'.
Checked source code and generated d.ts file, both proxy
and expose
are exported. Any idea why this is happening?
UPDATE:
fixed by import * as workly from 'workly/dist/workly.m.js';
Which isn't that intuitive.
fixed by
import * as workly from 'workly/dist/workly.m.js';
That's a work around.
I was using workerize but came to workly because of the clean and simple interface. Unfortunately ES6 import unreliable support was a deal breaker for my use case.
Will check again though
Maybe I miss something but when I do:
the
workly
object is empty.