Skip to content
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

Error: Can't resolve 'ReactDOM' in 'node_modules/react-simple-image-zoom/dist' #1

Open
ssemakov opened this issue Dec 27, 2018 · 1 comment
Assignees

Comments

@ssemakov
Copy link

Hi,

I'm getting this error when attempting to use ImageZoom in my project

./node_modules/react-simple-image-zoom/dist/ReactSimpleImageZoom.js
Module not found: Error: Can't resolve 'ReactDOM' in '/myproject/node_modules/react-simple-image-zoom/dist'
 @ ./node_modules/react-simple-image-zoom/dist/ReactSimpleImageZoom.js 1:102-121

It seems like it has something to do with case-sensitive-paths-webpack-plugin (which I don't use in my project) and externals definition in webpack.config.js
https://github.com/aaronlifton2/react-simple-image-zoom/blob/aa0b5a9376a3c7501c9a63154581d588f1272d1a/webpack.config.js#L27

My development webpack config is the following

const merge = require('webpack-merge');
const environment = require('./environment');
const FlowWebpackPlugin = require('flow-webpack-plugin');

const devConfig = {
  module: {
    rules: [
      {
        enforce: 'pre',
        test: /\.js(x?)$/,
        exclude: /node_modules/,
        loader: 'eslint-loader',
        options: {
          emitWarning: true,
        },
      },
    ],
  },
  plugins: [
    new FlowWebpackPlugin({
      reportingSeverity: 'warning',
      flowPath: require.main.require('flow-bin'),
      flowArgs: ['--color=always', 'frontend'],
    }),
  ],
};

module.exports = merge(environment.toWebpackConfig(), devConfig);

Can you please advice how to work around this problem?

@aaronlifton
Copy link
Owner

Hey there - thanks for filing a bug report.
Just updated the package so it will require react-dom by the correct name.
Should work now! (bumped to 0.1.5)

@aaronlifton aaronlifton self-assigned this Jan 14, 2019
@aaronlifton aaronlifton added bug Something isn't working and removed bug Something isn't working labels Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants