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

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

Closed
mironal opened this issue Jun 3, 2018 · 15 comments
Labels

Comments

@mironal
Copy link

mironal commented Jun 3, 2018

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

@welcome
Copy link

welcome bot commented Jun 3, 2018

👋 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.

@mironal mironal changed the title Module not found: Error: Can't resolve './EventStack' in '/root/project/app/node_modules/semantic-ui-react/dist/es/lib/eventStack' Module not found: Error: Can't resolve './EventStack' in './node_modules/semantic-ui-react/dist/es/lib/eventStack' Jun 3, 2018
@layershifter
Copy link
Member

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

@mironal
Copy link
Author

mironal commented Jun 3, 2018

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

@GuyShaanan
Copy link

GuyShaanan commented Jun 3, 2018

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.

@ghost
Copy link

ghost commented Jun 3, 2018

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
Copy link

tkw1536 commented Jun 3, 2018

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?

@mironal
Copy link
Author

mironal commented Jun 3, 2018

Please reopen this issue 😭 @layershifter

@layershifter
Copy link
Member

I reopened issue, the problem needs an investigation.

@layershifter layershifter added bug and removed triage labels Jun 3, 2018
@layershifter
Copy link
Member

layershifter commented Jun 3, 2018

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.

@liangz2
Copy link

liangz2 commented Jun 3, 2018

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.

@mironal
Copy link
Author

mironal commented Jun 4, 2018

Thanks for reopen a issue.

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

@levithomason
Copy link
Member

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

@levithomason
Copy link
Member

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

@Boasbabs
Copy link

Boasbabs commented Jun 4, 2018

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

@liangz2
Copy link

liangz2 commented Jun 4, 2018

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

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

No branches or pull requests

7 participants