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

Example webpack when yarn start - Module build failed: Error: Couldn't find preset "shopify/node" relative to directory ... #21

Closed
rafaedez opened this issue Apr 24, 2017 · 21 comments

Comments

@rafaedez
Copy link

Issue summary

When I´m testing the example "polaris/examples/webpack/" show me the error: "Module build failed: Error: Couldn't find preset "shopify/node" relative to directory"

Actual behavior

Inside polaris/examples/webpack, after yarn install and yarn start show me an error: "Module build failed: Error: Couldn't find preset "shopify/node" relative to directory ..."

Steps to Reproduce the Problem

  1. Inside polaris/examples/webpack;
  2. yarn install;
  3. yarn start.

Specifications

  • Polaris version: 1.0.0
  • React version: 15.4.2
  • Browser: Chrome
  • Device: PC
  • Operating System: Windows 10
@JoshHighland
Copy link

Was able to duplicate this

@chrispappas
Copy link

chrispappas commented Apr 24, 2017

Also reproducing this with Yarn 0.23.2, OSX 10.12.3, Node v7.7.1.

The yarn start command does work after doing a yarn install in the polaris project root (not just in the webpack example dir)

@ismail-syed
Copy link
Contributor

Hey @rafaedez, thanks for the issue. We've logged this issue internally; it will be solved in the next release.

This issue is related to the babel-loader conflicting with the root level babel config.

As @chrispappas mentioned, running a yarn install in the polaris project root will solve the issue.

@rafaedez
Copy link
Author

Hey guys, thanks for your help.
I did the command "yarn install" in the polaris project root and happened the error:

yarn install
yarn install v0.23.2
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone ssh://git@github.com/Shopify/js-uploader.git C:\Users\rafae\AppData\Local\Yarn\cache\v1.tmp\74afd5bd502652853dcb8a9fbb429196
Directory: D:\Estudo\Reactjs\polaris
Output:
Cloning into 'C:\Users\rafae\AppData\Local\Yarn\cache\v1.tmp\74afd5bd502652853dcb8a9fbb429196'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@chrispappas
Copy link

chrispappas commented Apr 24, 2017

Hi @rafaedez that doesn't look like anything wrong with the framework - that's a transport error from yarn, looks like some kind of git/SSH authentication issue?

Permission denied (publickey).
fatal: Could not read from remote repository.

@dhmacs
Copy link

dhmacs commented Apr 27, 2017

I'm having the same issue with version 1.0.2.. Any update on this? I'm also struggling trying to make it work with the fix proposed by @chrispappas since I'm having the same transport error reported by @rafaedez (I'm running the web app in a docker container)..
When will this be fixed?

@dhmacs
Copy link

dhmacs commented Apr 27, 2017

UPDATE: I'm not able to understand why since the installed version of Polaris is still the same (1.0.2), but now it works.. 😅

@lemonmade
Copy link
Member

Ha, I'm all too familiar with things magically starting to work at some point. Let us know if you have any more problems!

@chrispappas
Copy link

chrispappas commented Apr 27, 2017 via email

@dhmacs
Copy link

dhmacs commented Apr 29, 2017

@lemonmade the issue is back again.. how? I don't know, I've just built the app with webpack as usual and it fails with the same error.. the only thing that I can think of that has changed is the fact that I added other node modules this week.
I've managed to make it work again by using @chrispappas solution, but it's clearly just a temporary solution 😞

@dhmacs
Copy link

dhmacs commented May 4, 2017

Ehi @lemonmade any update on this? I can't make Polaris work on my project, I'm about to remove it from my project because otherwise I can't move forward.

@ismail-syed
Copy link
Contributor

@Macs91 Which issue are you referring to? Earlier you mentioned that solved it after verifying you were on v1.0.2?

@dhmacs
Copy link

dhmacs commented May 4, 2017

@ismail-syed not exactly, when I first installed Polaris it was already on version 1.0.2.. I got it working somehow by doing yarn inside node_modules/@shopify/polaris... But of course this is a work-around and it does not always work.. I've tried also to do a fresh install of Polaris, but the error is still there: Couldn't find preset "shopify/node" relative to directory ...

@ismail-syed
Copy link
Contributor

I just re-cloned and did the following, everything seemed to work.

$ cd polaris/examples/webpack
$ yarn install 
$ yarn start

@lemonmade
Copy link
Member

@Macs91 I'm having a little trouble understanding your issue, can you possible provide a minimal repo that reproduces the problem you are having?

@dhmacs
Copy link

dhmacs commented May 4, 2017

@lemonmade @ismail-syed here a minimal reproduction, I tried to remove everything that was not necessary:
https://github.com/macs91/polaris-issue

You can see the README for running the project and see what's the error.

Note: I'm running on Node 7.7.4 but there shouldn't be issues with lower version

@ismail-syed
Copy link
Contributor

Thanks for the repo, I'll take a look shortly.

@ismail-syed
Copy link
Contributor

@Macs91 Took a look at your sample repo. In the context of that repo, this is a valid concern. I was presuming you were talking about the webpack example app.

It seems that the babel config inside package.json is conflicting with external webpack builds. I have logged this internally, this will be fixed in our next release.

Thanks for bringing this to our attention 👍

@dhmacs
Copy link

dhmacs commented May 5, 2017

@ismail-syed I apologize that I haven't clearly stated that I was working on a personal repo.. Thanks for taking care of this.. Do you have an estimated date for the next release?

@lemonmade
Copy link
Member

We should have it out early next week. As an aide, this line in your web pack config looks incorrect: https://github.com/macs91/polaris-issue/blob/master/webpack/common.webpack.config.js#L9. It doesn't look to be actually excluding node_modules (should just be a regex, not a string of a regex). Changing that should also resolve this issue for you (and speed up your builds considerably).

@dhmacs
Copy link

dhmacs commented May 6, 2017

@lemonmade I knew I had a problem with the webpack config since the bundle was too big, but I'm rushing to keep the project on schedule so I didn't take the time to figure out what was causing the issue 😅 Big thank you for pointing this out to me! 👍 👍

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

6 participants