catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.79k stars 216 forks source link

Unable to resolve module `./build/common` #286

Closed rkrayovskyy-klarna closed 5 years ago

rkrayovskyy-klarna commented 5 years ago

Hi,

the following error is thrown when trying to bundle RN app with Metro:

start:packager     > error: bundling failed: Error: Unable to resolve module `./build/common` from `****/node_modules/libphonenumber-js/custom.js`: The module `./build/common` could not be found from `****/node_modules/libphonenumber-js/custom.js`. Indeed, none of these files exist:
start:packager     >   * `****/node_modules/libphonenumber-js/build/common(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
start:packager     >   * `****/node_modules/libphonenumber-js/build/common/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`

indeed, there is no such file or directory in /build.

anything I missing during installation/setup?

thanks, Roman

catamphetamine commented 5 years ago

Post full code and version.

rkrayovskyy-klarna commented 5 years ago

that was some weirdness with updating packages and lock file. thank you for a quick response, please disregard.

rcidt commented 5 years ago

@rkrayovskyy-klarna Could you please post what the solution is? Would really help others who have the same issue as you.

rkrayovskyy-klarna commented 5 years ago

Hi, it was purely on our end - resolving dependencies in the monorepo - I don't think it is relevant and helpful for others :)

Cheers Roman

On Fri, Jan 25, 2019 at 6:33 PM Ricardo Corrie notifications@github.com wrote:

@rkrayovskyy-klarna https://github.com/rkrayovskyy-klarna Could you please post what the solution is? Would really help others who have the same issue as you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/catamphetamine/libphonenumber-js/issues/286#issuecomment-457651730, or mute the thread https://github.com/notifications/unsubscribe-auth/Al3YEGBb-NOrcvxw6C06VhcqR42OcRL1ks5vGz_OgaJpZM4Z1a8O .

--

Roman Krayovskyy Engineering Manager - Shopping, Consumer App

+46 72 855 8268

Klarna Bank AB (publ) Sveavägen 46, 111 34 Stockholm https://maps.google.com/?q=Sveav%C3%A4gen+46,+111+34+Stockholm&entry=gmail&source=g Tel: +46 8 120 120 00 <+46812012000> Reg no: 556737-0431 klarna.com

rcidt commented 5 years ago

@rkrayovskyy-klarna I am running into the same issue. I had to downgrade to an earlier version due to this. I've tried clearing out cache's deleting lock files, etc. Nothing fixes it.

catamphetamine commented 5 years ago

@rcidt That's something cached on your machine because there's no build/common string in the current version of the package.