question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using this inside of a npm workspaces monorepo

See original GitHub issue

Seems to fail when used in a npm workspace.

wasmPack error

details of the error as it is expecting the package the projects node_module directory which is not possible with the workspace

npm pacakge does exist

located in the root node_module directory of the workspace/monorepo

This is a Svelte not a SvelteKit project but unsure that would make a difference.

Module does exist here

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
adoublefcommented, May 20, 2022

EDIT: It works, needed to add main field into my module’s package.json as the module was not working (wasm-pack built my module without the main and will need to look into why that was the case)

Still an error Screenshot (34)

Do you have an example of a wasm module built with rust that I could try?

My wasm module, located [here[(https://www.npmjs.com/package/@topheruk/hello-world) & although it is listed on the npm registry & I can load it in a Svelte app (by copying the wasm file into public folder and calling it inside the init function, with this plugin its not working.

0reactions
DoctorBracewellcommented, Jun 17, 2022

I’ve made a comment on an issue in the wasm-pack repo and will probably look into a pull request for wasm-pack to add the main field to its output - not 100% sure if that PR might have any unintended side-effects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Npm workspaces using TypeScript - Pablo Garcia
Run npm install at the root directory to make it available to every app inside the monorepo —even to other workspaces—. Lastly, make...
Read more >
NPM Workspaces Typescript unable to find local modules
I have a NodeJS monorepo set up using NPM ...
Read more >
[BUG] Wrong behaviour of `npm version` inside workspaces
After running npm version patch -m "chore: release %s " --workspaces --include-workspace-root command in monorepo, npm doesn't add inner ...
Read more >
Simplify your monorepo with npm 7 workspaces
To test our setup let's share a text from the ui library and import that string into our React app. Create the common...
Read more >
Working with monorepos - Expo Documentation
Yarn workspaces require the root package.json to be private. If you don't set this, yarn install will error with a message mentioning this....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found