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

Webpack 4 bug in package resolution #10158

Open
Stexxe opened this issue Nov 26, 2020 · 2 comments
Open

Webpack 4 bug in package resolution #10158

Stexxe opened this issue Nov 26, 2020 · 2 comments

Comments

@Stexxe
Copy link

Stexxe commented Nov 26, 2020

I have the problem described in the Stackoverflow question. If I triaged it correctly then there is a bug in Webpack 4 and it's a hard dependency of react-scripts.

I have the following solutions in mind for that problem:

  1. Don't use react-scripts. But I don't have an idea of how to build a React application without them.
  2. Fork markdown-it-prism package to specify the path to index.js explicitly.
  3. Somehow use Webpack 5 with react-scripts.

If you have any ideas about how to fix it in a better way then I would really appreciate your help.

@threepointone
Copy link

Could you make an example project that reproduces this problem? Happy to have a look if so, because the behaviour seems odd.

@Stexxe
Copy link
Author

Stexxe commented Dec 1, 2020

@threepointone thank you for replying.

The first sample project uses react-scripts to illustrate the high-level problem
webpack-markdown-it-bug.zip. To reproduce run npm install, npm start and see the error in a browser.

The second sample project uses Webpack 4 and contains minimized code for the problem webpack-bug.zip. To reproduce run npm install, npm run build, and open index.html in the browser. In the console, by the output, you will see that the wrong file was required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants