Comments (25)
And thanks for helping me debug this. And now we've got a handy package out of the deal. Sweet!
from indie-stack.
Remix 1.3.3 with latest Indie template works on Windows 11.
from indie-stack.
Oh, now that's weird... What is that @ECHO off
thing 🤔
I'm guessing that's a windows binary thing. I may need to account for that in my new https://npm.im/binode package... Once we figure out the right way to handle that then we should be good.
from indie-stack.
I had the same issue on windows, fixed by changing the dev:remix script:
"dev:remix": "node --require ./mocks ./node_modules/@remix-run/dev/cli.js"
from indie-stack.
It also happens if you add the npx to the script as you mentioned in your previous comment.
from indie-stack.
Did a small test here locally:
If I did a join on the nodeargs it worked,
binode/bin.js
spawnSync(whichBinPath, binArgs, {
env: { ...process.env, NODE_OPTIONS: nodeArgs.join(" ") },
stdio: "inherit",
});
Hope it helps!
from indie-stack.
from indie-stack.
npm run validate output
from indie-stack.
Changed the following script in the package.json file
"dev:remix": "node --require ./mocks ./node_modules/.bin/remix dev",
to "dev:remix": "remix dev",
from indie-stack.
I have done the above and still have this error showing up...
from indie-stack.
Hey @kentcdodds ! I just did an install after your new commit.
The installation is good but when I use the "npm run dev" command I always get the following error:
I think we should really see what's wrong with "mock server" and the syntax error.
from indie-stack.
@oddig thanks ! It works now for me.
from indie-stack.
npm run validate still doesn't work however even with the above fix...
@mickasmt and @oddig can you confirm whether validate works for you?
from indie-stack.
Unfortunately running on a windows machine does not always work at first glance 😭 .
Try this, it worked for me at least:
"start:mocks": "node --require ./mocks ./node_modules/@remix-run/serve/cli.js build"
from indie-stack.
The above works for me! thanks @oddig
from indie-stack.
When npm
installs packages with a bin
script, it will generate a bash file as well as a .cmd and .ps1 file in the .bin
folder.
Typically if you were to just run npx remix dev
, npm will do the right thing and pick the appropriate script based on the platform you're on.
However, when you are running node
directly, like the default "dev" script, npm is no longer doing the platform check, so in this case it's trying to load the bash script instead (has no extension), which obviously won't work on Windows.
node --require ./mocks ./node_modules/.bin/remix dev
Since we're using the node process to import mocks, we should always load the JS script directly, like @oddig solution.
node --require ./mocks ./node_modules/@remix-run/dev/cli.js
All templates and examples should be updated that use node
directly instead of npm
to run.
from indie-stack.
Could you try the latest version? I'm pretty sure this is resolved now.
from indie-stack.
Unfortunately it does not work.
from indie-stack.
It is for prevent echoing commands at the command prompt, it is the first line in the remix.cmd file.
Edit: If you need someone to test for you, just give a shout 👍
from indie-stack.
Looks like we'll have to figure out how npm executes binaries and either execute them the same way or somehow use npm to execute them. I'm guessing it won't be terribly complicated if we can just use npm to execute them and just update this to do it: https://github.com/kentcdodds/binode/blob/07c94ffdac32fd621b463d5269acf069040f36bf/bin.js#L16
from indie-stack.
Two things:
- If anyone on a windows machine could give me what the contents of
./node_modules/.bin/remix.CMD
are that would be helpful - I'm pretty sure if you updated the script to be
binode --require ./mocks -- npx remix dev
then that would work
But I'd still like to figure out how to avoid the npx
bit there.
from indie-stack.
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@remix-run\dev\cli.js" %*
from indie-stack.
I think I got it in the latest result of binode. Could you give the latest version a try please?
from indie-stack.
Ok, I think I finally fixed it. Please try again!
from indie-stack.
Huzzah! Thanks for your patience all!
from indie-stack.
Related Issues (20)
- Logout directly by hiting http://localhost:3000/logout should remove the cookie stored in the browser HOT 3
- Collaborator init script is missing HOT 5
- Warning: Expected server HTML to contain a matching <meta> in <head> HOT 5
- Fly Instance runs out of memory on deployment HOT 11
- Failed app run HOT 3
- Missing Environment Variables when Prisma is removed HOT 3
- Env variables undefined in build but fine in dev HOT 1
- pnpm is not preinstalled and causes an error in Cypress HOT 3
- No region defined in the fly deploy command, causes deployment to crash HOT 10
- Remix and Cypress hydration problem HOT 7
- hydration failed,and css file will request twice HOT 1
- npm run dev errors out in windows machines with "Cannot find module '--require/package.json'"
- Error during deployment in Fly.io, Dockerfile needs to give permissons to `start.sh` script HOT 3
- Timeout when Running e2e tests on a fresh installation
- Typecheck fails because it can't find definitions for cypress or @testing-library/cypress HOT 6
- throw new Error(`Failed to kill process ${pid}: ${error}`) after code change HOT 3
- Tailwind SourceMap/EsBuild Issue HOT 4
- Error upon deployment: you must be authenticated
- Cypress custom commands doesn't load HOT 2
- Use `fly launch`/`dockerfile-node` instead of `.dockerignore`, `Dockerfile`, `fly.toml` & `start.sh` HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from indie-stack.