-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Cannot find module" from .ts file. #26
Comments
Your folder is:
right? And what cmd did you use to complie the |
Yes, thats right. Compiled the typescript via > tsc -p . - the build does a
then
Which is when the error from typescript occurs. I've attempted to work around this using a js thunk file - I copied the .d.ts from the rust pkg directory to 'src/wasmthunk.d.ts' and made a 'wasmthunk.js' that imports from the Cargo.toml and then exports everything. That sort of worked. I say sort of worked because its throwing an error in the browser:
which is from
Thank you for responding so amazingly fast btw! |
Re the workaround failing, we bundle twice: once for browser and once for node:
and
Then we call |
In my own test project, I can directly use |
I encountered a similar sort of thing to this - I believe that the reason that To "prove" this you can move the definition generated by I think that one option for this would be to merge the generated definitions into This merging & string-twiddling does seem brittle to me so perhaps it would be better to export the raw |
I'm having the same problem, it's a huge headache. This issue is also related: rustwasm/wasm-bindgen#182 (comment) |
I've spent a couple days trying to figure this out* and settled on
|
I've found a partial* workaround for this: |
I'm not sure whats going on here - rather new to parcel. I have a wasm project in a parallel direction to the js tree:
in foo.ts I have tried each of
all of them report 'Cannot find module'.
The npm project using parcel is an existing mature code base that works fine in other regards as far as I can tell :).
Any suggestions? Is this a supported feature?
The text was updated successfully, but these errors were encountered: