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

"unstable_dev" not working on Windows #6308

Closed
1 task done
trevor-hackett opened this issue May 4, 2023 · 11 comments
Closed
1 task done

"unstable_dev" not working on Windows #6308

trevor-hackett opened this issue May 4, 2023 · 11 comments

Comments

@trevor-hackett
Copy link

What version of Remix are you using?

1.16.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

On a Windows machine, create a new Remix app with unstable_dev enabled. (ex: npx create-remix@latest --template https://github.com/remix-run/remix/tree/templates_v2_dev/templates/remix my-app)

Run the app. (npm run dev)

Expected Behavior

Dev server and app server runs successfully

Actual Behavior

App server fails to run with these logs:

> dev
> remix dev

💿 Building...
💿 Built in 508ms
Waiting for app server (13c89a7f)
> remix-serve build\index.js
Remix dev server ready
'remix-serve' is not recognized as an internal or external command,
operable program or batch file.
@pcattori
Copy link
Contributor

pcattori commented May 5, 2023

@trevor-hackett do you have @remix-run/serve installed and remix-serve within node_modules/bin?

Can you also try adding a test script to package.json and running it?

{
  "scripts": {
    "test": "remix-serve ./build",
  }
}
npm run test

@trevor-hackett
Copy link
Author

Yes. @remix-run/serve is installed and I do see remix-serve inside node_modules/.bin

After adding the test script, the app server starts up by itself.

Here's the two scripts run one after the other:

PS D:\dev\my-app22> npm run dev

> dev
> remix dev

💿 Building...
💿 Built in 531ms
Waiting for app server (b0701266)
> remix-serve build\index.js
Remix dev server ready
'remix-serve' is not recognized as an internal or external command,
operable program or batch file.
Terminate batch job (Y/N)? y

PS D:\dev\my-app22> npm run test

> test
> remix-serve ./build

Remix App Server started at http://localhost:3000 (http://192.168.169.228:3000)

It might be worth mentioning that if I turn off unstable_dev it runs without issue.

This only happens on Windows from what I can tell. On the same machine running in WSL (Ubuntu) it works without any issues.

@pcattori
Copy link
Contributor

pcattori commented May 5, 2023

@pcattori
Copy link
Contributor

pcattori commented May 5, 2023

Potentially fixed by #6310

@pcattori
Copy link
Contributor

pcattori commented May 5, 2023

@trevor-hackett to verify that the PATH is the cause of the issue, could you try:

{
  "scripts": {
    "test": "echo $PATH",
  }
}

Also since #6310 is merged, you can try the npx create-remix@nightly tomorrow (nightlies get published ~3am ET)

@trevor-hackett
Copy link
Author

trevor-hackett commented May 5, 2023

I poked around at the the code in that file and changing the : to ; on this line fixed the issue for me.

PATH: `${bin}:${process.env.PATH}`,

I logged out that path and it was the only path that wasn't separated by a ;

This is what the path variable being passed to execa.command() looked like before the change:

D:\dev\my-app22\node_modules\.bin:D:\dev\my-app22\node_modules\.bin;C:\Users\trevor\AppData\Roaming\npm\node_modules\pnpm\dist\node-gyp-bin;C:\Program Files\WindowsApps\Microsoft.PowerShell_7.3.4.0_x64__8wekyb3d8bbwe;C:\Python311\Scripts\;C:\Python311\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Users\trevor\AppData\Local\pnpm;C:\Users\trevor\scoop\shims;C:\Users\trevor\AppData\Local\Microsoft\WindowsApps;C:\Users\trevor\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\trevor\.dotnet\tools;C:\Users\trevor\AppData\Roaming\npm;C:\Users\trevor\AppData\Local\gitkraken\bin;C:\Users\trevor\AppData\Local\GitHubDesktop\bin

I don't know if that "fix" would work outside of Windows.

@pcattori
Copy link
Contributor

pcattori commented May 5, 2023

Conditionally joining PATH with ; on Windows and : on all other OSs: #6312

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-d8bcdc1-20230506 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions github-actions bot closed this as completed May 6, 2023
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.16.1-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.16.1 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@jgentes
Copy link

jgentes commented Jun 8, 2023

I can confirm this fix worked 👍

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

No branches or pull requests

4 participants