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.

Webpack 3.x and countries

See original GitHub issue

Hey there! I’m trying to add your module to one of my projects, but I’m getting the next error when I try to add your component to my view:

ERROR in ./node_modules/react-phone-number-input/modules/Input.js

Module not found: Error: Can't resolve './countries' in '<my-local-path>/node_modules/react-phone-number-input/modules'
 @ ./node_modules/react-phone-number-input/modules/Input.js 22:0-40
 @ ./node_modules/react-phone-number-input/index.js
 @ ./app/consumer-support/user/user/verification-details/consumer-details-modal/index.js
 @ ./app/consumer-support/user/user/verification-details/index.js
 @ ./app/consumer-support/user/user/index.js
 @ ./app/consumer-support/user/index.js
 @ ./app/consumer-support/index.js
 @ ./app/index.js
 @ ./app/render.js
 @ ./index.js
 @ multi webpack-hot-middleware/client?path=http://localhost:4000/__webpack_hmr react-hot-loader/patch babel-polyfill bootstrap-sass/assets/javascripts/bootstrap ./index

When I change the line 22 in ./node_modules/react-phone-number-input/modules/Input.js from import country_names from './countries'; to import country_names from './countries.json'; everything works, am I missing something or?

Webpack version: 3.0.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
catamphetaminecommented, Oct 26, 2017

You’re not the first one and you’re not the last one

0reactions
nidzolacommented, Oct 26, 2017

Awesome! Thanks for helping, after adding .json in extensions array, everything is working as expected! 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

To v2 or v3 from v1 - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
How to not rely on relative paths in React/Webpack 3 app
My project's main folder is called app . I've tried both of these in my webpack.config.babel.js but with no luck so far. 3.x...
Read more >
Issue loading with Webpack 3.5.5 #61 - GitHub
This might be a config issue on my side, but thought I'd mention it. webpack:///./node_modules/i18n-iso-countries/index.js?:43 codes.
Read more >
Understanding a Comparison: Webpack vs ViteJS - Radixweb
Enhanced Performance of Vite JS. Vite uses modern web browsers that allow native ESM modules to drastically reduce startup and rebuild times.
Read more >
Starting the agent | APM Node.js Agent Reference [3.x] - Elastic
optionally exclude other modules from the bundle that you would like the APM agent to instrument. "Excluding" a module foo from the bundle...
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