Semantic-UI-React: Module not found: Error: Can't resolve './EventStack' in './node_modules/semantic-ui-react/dist/es/lib/eventStack'

Hi! Thanks very useful library. πŸ˜„

Bug Report

I got a build error in Linux (alpine linux) environment. 😭 When in Mac environment, I don’t get an error.

I think that eventStack.js must be EventStack.js.

image

Steps

  1. Add semantic-ui-react to the package.json dependencies.
  2. run yarn
  3. run yarn build: I use webpack & typescript.
  4. I got error.

Actual Result

I got following error.

ERROR in ./node_modules/semantic-ui-react/dist/es/lib/eventStack/index.js
Module not found: Error: Can't resolve './EventStack' in '/root/project/app/node_modules/semantic-ui-react/dist/es/lib/eventStack'
 @ ./node_modules/semantic-ui-react/dist/es/lib/eventStack/index.js 1:0-38 2:19-29
 @ ./node_modules/semantic-ui-react/dist/es/lib/index.js
 @ ./node_modules/semantic-ui-react/dist/es/collections/Grid/GridRow.js
 @ ./node_modules/semantic-ui-react/dist/es/index.js
 @ ./src/App.tsx
 @ ./src/index.tsx

Version

0.81.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Fixed in semantic-ui-react@0.81.1. The tarball also includes the properly cased EventStack.js file.

Please re-open. The file in dist/lib/eventStack is eventStack.js starting with a lower β€˜e’ instead of capital β€˜E’ which is required by dist/lib/eventStack/index.js:

image

Did rm -rf node_modules yarn.lock. Same file gets downloaded.

Hey folks, I’ll release a patch for this as soon I finish investigating why the camelCased eventStack.js was built. Standby.

Try to reinstall deps fully, the master branch has a needed file, see the folder

Rename
/node_modules/semantic-ui-react/dist/es/lib/eventStack/eventStack.js to /node_modules/semantic-ui-react/dist/es/lib/eventStack/EventStack.js

fix the error

@tkw1536 Thanks. Your solution helped fix the bug on my machine

I reopened issue, the problem needs an investigation.

I tried to download the tar boll from https://registry.npmjs.org/semantic-ui-react/-/semantic-ui-react-0.81.0.tgz.

And I extract it. I got eventStack.js file. Is this the correct file? @layershifter

image

The master branch and the v0.81.0 tag has the correctly named EventStack.js file. I tried to perform the build locally and everything went okay.

The v0.81.0 contains a valid file in the src folder, however dist folders contains a wrong eventStack.js file 😭 Merged #2870 with same problem.

An example on codesandbox.

@levithomason can you check, please? As I’m remember you’re running builds locally.

Please reopen this issue 😭 @layershifter

I am affected by this issue as well, it is especially annoying because this only occurs in my automated tests (which run on Travis CI / Linux), and not in my development environment (Mac OS).

I furthermore tried the fix from @wallena3, and noticed that it did not work in commonjs environments. To completely fix the issue, I had to use:

mv node_modules/semantic-ui-react/dist/es/lib/eventStack/eventStack.js node_modules/semantic-ui-react/dist/es/lib/eventStack/EventStack.js

mv node_modules/semantic-ui-react/dist/commonjs/lib/eventStack/eventStack.js node_modules/semantic-ui-react/dist/commonjs/lib/eventStack/EventStack.js 

Having to add these lines everywhere is less than optimal, as it is no longer possible to install semantic-ui-react as a package.json dependency and manual intervention is required.

Can this issue please be re-opened and fixed?