nodegui/svelte-nodegui

bug: app gives module not found on startup when trying to use npm package

mrsauravsahu opened this issue · 2 comments

Issue

Cannot resolve phin package

  • Here's a screenshot of the error.

Screenshot 2021-02-24 at 5 35 56 PM

Workaround

Installing phin with an npm install phin fixes this issue for now.

@mrsauravsahu Thanks for catching this! Aiming to fix it now.

I had a lot of problems before trying to find a way to bundle phin. It's something to do with a disagreement between commonjs modules (which we have one loader for) and esm modules (which are rollup's default), possibly complicated by TypeScript and default exports.

It's further complicated by the rollup config, with its declaration of internal vs. external modules.

As I don't want this to hold up the alpha release (and I'm not confident I can fix it anyway), I've decided to just declare it as a peer dependency of @nodegui/svelte-nodegui for now, and have satisfied that peer dependency in the svelte-nodegui-starter template, which builds and runs happily.

The commit of mention: a62490e