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

Can't get the project to run locally on Windows #78

Closed
Madses opened this issue Dec 7, 2023 · 25 comments · Fixed by #115
Closed

Can't get the project to run locally on Windows #78

Madses opened this issue Dec 7, 2023 · 25 comments · Fixed by #115
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Madses
Copy link

Madses commented Dec 7, 2023

Node version: v18.18.1
NPM: 9.8.1

Steps followed:

  • Forked the repository
  • Ran npm install in the root directory
  • Ran npm start -w docs

image

Error: Cannot find package 'C:\Users\Kevin\Documents\stylex\node_modules\@stylexjs\babel-plugin\' imported from C:\Users\Kevin\Documents\stylex\apps\docs\babel-virtual-resolve-base.js

Am I missing a step? It seems every command I try (build) results in some sort of error.

https://github.com/facebook/stylex/blob/main/.github/CONTRIBUTING.md

@nmn nmn added the bug Something isn't working label Dec 7, 2023
@nmn
Copy link
Contributor

nmn commented Dec 7, 2023

Did you already run npm i at root of the repo?

Otherwise, this feels like a Windows incompatibility. I will find my PC and try to reproduce this issue.

@nmn nmn added the help wanted Extra attention is needed label Dec 7, 2023
@Madses
Copy link
Author

Madses commented Dec 7, 2023

Yeah first thing I did. I will also try to get it working on my macbook. Will get back to you with my results as soon I get the chance

@nedjulius
Copy link
Contributor

nedjulius commented Dec 7, 2023

I had the same issue on macOS Ventura 13.3.1 running Node 18.19.0. Was able to start the development server after I manually built @stylexjs/babel-plugin, @stylexjs/eslint-plugin, @stylexjs/shared and @stylexjs/stylexjs.

@Madses
Copy link
Author

Madses commented Dec 7, 2023

UPDATE: yeah, I seem to be getting similar issues on Mac OS.

@Madses
Copy link
Author

Madses commented Dec 7, 2023

@nedjulius

Maybe a silly question, but how exactly do I manually build these?

@nedjulius
Copy link
Contributor

nedjulius commented Dec 7, 2023

@nedjulius

Maybe a silly question, but how exactly do I manually build these?

According to the root README, you can either build all packages at once or specify the package name with -w flag. I tried building them all, but it failed (I assume because some of the packages don't have a specified build command) so I just built the dependencies of the docs app. I did that by running the npm run build -w <package-name> with each of the packages that I listed above.

@Madses
Copy link
Author

Madses commented Dec 7, 2023

Even this seems to be an issue at the moment:

Run `npm audit` for details.
PS C:\Users\Kevin\Documents\stylex\apps\docs> npm run build -w @stylexjs/babel-plugin

> @stylexjs/[email protected] prebuild
> gen-types -i src/ -o lib/

Failed to process file: C:\Users\Kevin\Documents\stylex\packages\babel-plugin\src\utils\dev-classname.js
SyntaxError: ';' expected (10:6)
 need to maintain the full path to the file eventually
      ^
    at Object.parse (C:\Users\Kevin\Documents\stylex\packages\scripts\node_modules\hermes-parser\dist\HermesParser.js:91:29)```

@purohitdheeraj
Copy link
Contributor

i am facing same issue, is there any preferred way for windows 🪟
followed the readme , but looks like it gives legacy peer dependencies error

@nonzzz
Copy link
Contributor

nonzzz commented Dec 7, 2023

Did you build the babel plugin before running the doc?

@purohitdheeraj
Copy link
Contributor

i did that npm run build and got that peer dependency error
actually followed the readme file
@nonzzz can you please elaborate that or if its already in readme or guidelines then just share that
thanks

@nonzzz
Copy link
Contributor

nonzzz commented Dec 7, 2023

@purohitdheeraj Sorry i tried to reproduce but failed :(
I tried switch node v18.12.1 and v20.4.0. My system is windows.

@kevintyj
Copy link
Contributor

kevintyj commented Dec 7, 2023

Hi everyone you can run the following command to build the necessary files check #67

$ npm run build -w @stylexjs/stylex -w @stylexjs/shared -w @stylexjs/eslint-plugin -w @stylexjs/babel-plugin

Its mentioned in the readme for the docs section as well at the very top :)

@ncharanaraj
Copy link

Hi everyone, I tried the above commands but I'm getting errors. @kevintyj Can you please help?
Screenshot (104)

@kevintyj
Copy link
Contributor

kevintyj commented Dec 7, 2023

Hi everyone, I tried the above commands but I'm getting errors. @kevintyj Can you please help?

I don't see a node_modules folder, did you run npm install?

@ncharanaraj
Copy link

ncharanaraj commented Dec 7, 2023

@kevintyj Did not worked, After running npm install

@Madses
Copy link
Author

Madses commented Dec 7, 2023

I'm still having the same issues after running npm run build -w @stylexjs/stylex -w @stylexjs/shared -w @stylexjs/eslint-plugin -w @stylexjs/babel-plugin

as suggested by @kevintyj

image

EDIT: works on mac OS !

@necolas necolas changed the title Can't get the project to run locally. Can't get the project to run locally on Windows Dec 7, 2023
@vaishnavrajendran
Copy link

image
Cannot able to do npm install on windows machine. My node version is 18 and npm version is 9.8

@kevintyj
Copy link
Contributor

kevintyj commented Dec 8, 2023

image

Cannot able to do npm install on windows machine. My node version is 18 and npm version is 9.8

Can you reset to head and delete all non tracked files and run non install again?
git reset --hard HEAD
git clean -fdX
If this doesn't work, try to use node v21.
Also was wondering what shell you are using?

@timwehrle
Copy link
Contributor

Using the latest version of Node.js won't fix the issue.

@nmn
Copy link
Contributor

nmn commented Dec 9, 2023

We're updating the instructions, but when you first clone the repo the very next steps are:

$ npm install
$ npm run build

You can't build and run the docs website without first running npm run build at the root directory. npm run build will build everything and then you can work on specific parts as needed.


Hermes Parser error

Looking at all the error reports, looks like there is a bug with hermes-parser on windows. Could someone try running this with WSL and see if that fixes the problem?

@timwehrle
Copy link
Contributor

@nmn Yes, using a WSL works. But it would be great to find the issue so we don't have to start a WSL every time.

@nmn
Copy link
Contributor

nmn commented Dec 9, 2023

@weti09 Yes, working on getting this problem solved, but it's good to know that there is a workaround available in the meantime.

@nmn
Copy link
Contributor

nmn commented Dec 9, 2023

Quick Update: I have reproduced the problem and identified the various causes for breakages.

EDIT: Ignore what I said earlier, I think I've found the fix for the problem. I'll merging it shortly.

@timwehrle
Copy link
Contributor

Maybe add a link to the workaround in the Contribution Guide (if not already done)? This would help avoid more questions about this until more fixes are available.

@nmn
Copy link
Contributor

nmn commented Dec 9, 2023

I hope to fix everything such that no workarounds are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants