pwa-studio icon indicating copy to clipboard operation
pwa-studio copied to clipboard

[bug]: yarn create @magento/pwa stuck at first question on Windows

Open fahadjabbar8 opened this issue 4 years ago • 23 comments

Describe the bug When i am trying to use the cli command yarn create @magento/pwa its is stuck in the first question and giving error for almost any string address i provide Invalid directory path; contains illegal characters.

To reproduce Steps to reproduce the behavior:

  1. Go to windows PC install all dependencies mentioned latest python, node , yarn
  2. Now to setup this project move a sample directory i tried D:\Projects
  3. Run yarn create @magento/pwa
  4. After Installing create-pwa 1.0 with binaries it is stuck at first question for any thing i type as directory
  5. I tries test , ../test , anything it is keep on giving the error Invalid directory path; contains illegal characters

Expected behavior Should run to next question as it is a valid path.Something other is happening

Screenshots Screenshot (28) Screenshot (29) Screenshot (30)

  • Device PC
  • OS Windows 10
  • NPM version :6.4.1
  • yarn version :1.16.0
  • Node Version : 10.15.3 -Python : 3.8.2

Please let us know what packages this bug is in regards to:

  • [ ] create-pwa

Guidance

Copied from my comment below:

Thanks for the input @jissereitsma! We would welcome a contribution (from anyone 😄) that:

  • Copies https://github.com/jonschlinkert/is-invalid-path/blob/master/index.js to our repo as a utility within create-pwa/util.
  • Removes the is-invalid-path dependency from the create-pwa/package.json.
  • Replaces the import with the copied local utility.
  • Adds tests (perhaps copy and improve upon these).

Doing the above will at least remedy the issue which @jissereitsma noted may prevent at least this line from executing in Windows. That said, I'm not sure if the app will function even if you get it to scaffold. Still, we should avoid non-maintained dependencies so I think this is a good idea.

fahadjabbar8 avatar Apr 18 '20 16:04 fahadjabbar8

I have gone through your package code and identified the issue is with this package is-invalid-path at line number 31 in create-pwa index file where its being used for validating path apparently this package is suppose to validate only windows path as per package documentation but as ironic as it seems it might be failing for windows only :)

For now updating the local cli code to generate the project but would love to see you guys use some different package for it since its failing in first question for windows platform.

fahadjabbar8 avatar Apr 19 '20 02:04 fahadjabbar8

Might not be the reason you setup is failing but you don't really wanna develop your project on windows directly. I'd suggest trying the docker setup, saves you a lot of headaches in the long run.

Jordaneisenburger avatar Apr 20 '20 12:04 Jordaneisenburger

@Jordaneisenburger Are you referring the complete source code one having all packages locally or is there an independent setup using yarn create @magento\pwa with a docker configuration file i would be interested in the second one.

fahadjabbar8 avatar Apr 20 '20 12:04 fahadjabbar8

@fahadjabbar8 - Our docker setup is in the monorepo, and is not distributed or supported in a scaffolded app (yarn create @magento/pwa). The docker files are hard-coded to monorepo paths, but could easily be used as a template on how to roll your own.

I would suggest using the Linux sub-system if available, otherwise Docker would be your next best bet. We'll still review this in our grooming, but Windows support has been low on the priority list. If we helped identify areas that needed to be made Windows compatible, would you be interested in contributing those changes to the repo?

tjwiebell avatar Apr 20 '20 13:04 tjwiebell

Created in Jira backlog

awilcoxa avatar Apr 20 '20 17:04 awilcoxa

@tjwiebell We have decided to go with vagrant since its failing on next steps and even to build the project as well. This issue is an easy fix and i would love to do that but the issues after that need some more time to think through. With current support of pwa-studio for windows its really hard to work with windows environment. The easiest solution could be docker support for scaffolded app i.e for yarn create @magento\pwa since a lot of people including us start by cloning the whole cli and core pwa-studio hence starting the setup with a wrong first step.

I would love you guys to put scaffolded app docs in the getting started phase and if you could provide the dedicated pwa-studio slack channel that would be cool.

fahadjabbar8 avatar Apr 20 '20 20:04 fahadjabbar8

Closing this as a bug per Tommy's comment, Window's support currently doesn't exist for scaffolding.

awilcoxa avatar Apr 27 '20 18:04 awilcoxa

To further document this issue, it seems that this bug is related to the following issue: https://github.com/jonschlinkert/is-invalid-path/issues/2 A PR to fix this has been created as well https://github.com/jonschlinkert/is-invalid-path/pull/3 but it seems as if the creator is no longer maintaining this package.

My recommendation would be to abandon the usage of this package alltogether and simply copy the lines of the original package (plus the PR) into the codebase here. Or fork the original repo.

jissereitsma avatar May 12 '21 14:05 jissereitsma

Thanks for the input @jissereitsma! We would welcome a contribution (from anyone 😄) that:

  • Copies https://github.com/jonschlinkert/is-invalid-path/blob/master/index.js to our repo as a utility within create-pwa/util.
  • Removes the is-invalid-path dependency from the create-pwa/package.json.
  • Replaces the import with the copied local utility.
  • Adds tests (perhaps copy and improve upon these).

Doing the above will at least remedy the issue which @jissereitsma noted may prevent at least this line from executing in Windows. That said, I'm not sure if the app will function even if you get it to scaffold. Still, we should avoid non-maintained dependencies so I think this is a good idea.

sirugh avatar May 12 '21 15:05 sirugh

@magento export issue to JIRA project PWA as Bug

sirugh avatar May 12 '21 15:05 sirugh

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/PWA-1726 is successfully created for this GitHub issue.

github-jira-sync-bot avatar May 12 '21 15:05 github-jira-sync-bot

@sirugh I wanted to confirm as a step one whether this would be a smart idea. A bummer is that I don't have a Windows machine to test this on. First 3 steps don't require much, except for minor stuff.

jissereitsma avatar May 17 '21 05:05 jissereitsma

I wanted to confirm as a step one whether this would be a smart idea. A bummer is that I don't have a Windows machine to test this on. First 3 steps don't require much, except for minor stuff.

@jissereitsma the issue you noted is relevant - the dependency is outdated. So regardless of whether the rest of the app actually functions on Windows, we will at least have to do this first step, after which we can open further bugs/issues if Windows support is desired. I will note that in the past our PM has stated that this is not something we will support right now, but if community folks wanted to help out here we would certainly be open to it :)

sirugh avatar May 17 '21 12:05 sirugh

As per https://magento.github.io/pwa-studio/frequently-asked-questions/ we're not supporting Windows development necessarily, but if someone from community wants to do this work (as detailed by my above comment) we're open to accepting it.

Until then this will sit in "ready for dev" or eventually be closed as stale.

sirugh avatar May 18 '21 18:05 sirugh

@sirugh I want to contribute to this issue.

guilhermeamadowj avatar Aug 13 '21 17:08 guilhermeamadowj

+1

shamseerahammedm avatar Aug 24 '21 14:08 shamseerahammedm

Hello, I have read the user manual but still do not know how to do the above steps, please explain more or have a video tutorial to help me, I really need it and don't have a solution.

  • Copies https://github.com/jonschlinkert/is-invalid-path/blob/master/index.js to our repo as a utility within create-pwa/util.
  • Removes the is-invalid-path dependency from the create-pwa/package.json.
  • Replaces the import with the copied local utility.
  • Adds tests (perhaps copy and improve upon these).

huanth avatar Nov 23 '21 09:11 huanth

  1. Go to windows PC install all dependencies mentioned latest python, node , yarn
  2. Now to setup this project move a sample directory i tried D:\Projects
  3. Run yarn create @magento/pwa
  4. it will stops from create project root directory error-while-creating-pwa-studio-setup-in-local-windows

DeepShah2511 avatar Jun 05 '23 05:06 DeepShah2511

Still the same issue happening even in Jan 2024, when running scaffold related command for yarn. image

balanandula avatar Jan 26 '24 06:01 balanandula

same issue in Jan 2024, its ridiculous that even in 2024 developers will completely disregard an entire OS especially one as popular and mainstream as Windows. If this doesn't work on Windows then something on the Adobe site for the PWA should mention that

bastianhilton avatar Jan 29 '24 03:01 bastianhilton