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

Created on 3 Jun 2018  路  15Comments  路  Source: Semantic-Org/Semantic-UI-React

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

bug

Most helpful comment

Fixed in [email protected]. The tarball also includes the properly cased EventStack.js file.

All 15 comments

馃憢 Thanks for opening your first issue here! If you're reporting a 馃悶 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

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

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

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.

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

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?

Please reopen this issue 馃槶 @layershifter

I reopened issue, the problem needs an investigation.

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 :sob: Merged #2870 with same problem.

An example on codesandbox.

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

Renaming the file does solve the issue locally, but when another dev tries to work with the new version, he/she will have to perform the same fix on their machine - not a very long term fix. With that said, thanks for the suggestion, I can do my local development for now.

Thanks for reopen a issue.

Was the publishing process broken?
I patiently wait to fix.

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

Fixed in [email protected]. The tarball also includes the properly cased EventStack.js file.

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

Hi, has the NPM package been generated? I got a message saying "No matching version found for [email protected]". Thanks.

Was this page helpful?
0 / 5 - 0 ratings