Error deploy remix/turbo rep

Error: Failed to resolve “@remix-run/dev”. To fix this error, add “@remix-run/dev” to “dependencies” in your package.json file.

Is @remix-run/dev in the package.json file devDependencies?

Yes its in both package.json.

Why is remix/dev needed in prodution?

The @remix-run/dev package contains the Remix CLI, so you wouldn’t want to deploy it to production.
Instead, if you’re using latest for @remix-run, you would have these in your package.json’s dependencies section for a “production” deployment:

"@remix-run/node": "^2.12.1",
"@remix-run/react": "^2.12.1",
"@remix-run/serve": "^2.12.1",

I’m curious as to why you’re seeing the error itself stating you need to add the @remix-run/dev to your dependencies though :thinking:. What were you doing when that error cropped up?

2 Likes

I was deploying the app to Vercel. Not sure why its asking for @remin-run/dev when I am doing a deployment.

Here is my package.json

{
“name”: “customer-portal”,
“private”: true,
“sideEffects”: false,
“type”: “module”,
“scripts”: {
“build”: “NODE_ENV=production remix build”,
“dev”: “PORT=51580 remix dev --manual”,
“lint”: “eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .”,
“start”: “NODE_ENV=production POYNT_URL=‘https://poynt.net/snippet/poynt-collect/bundle.js’ POYNT_APP_ID=‘urn:aid:df5ae5f0-6360-4024-819f-b7a17b92d5c7’ node server.js”,
“typecheck”: “tsc”
},
“dependencies”: {
@elastic/elasticsearch”: “^8.12.2”,
@remix-run/css-bundle”: “^2.5.1”,
@remix-run/node”: “^2.12.1”,
@remix-run/react”: “^2.12.1”,
@remix-run/serve”: “^2.12.1”,
“dotenv”: “^16.4.5”,
“is-ip”: “^5.0.1”,
“isbot”: “^4.1.0”,
“react”: “^18.2.0”,
“react-code-input”: “^3.10.1”,
“react-dom”: “^18.2.0”,
“react-hook-mask”: “^1.1.18”,
“react-signature-pad-wrapper”: “^3.4.0”,
“remix-utils”: “^7.5.0”
},
“devDependencies”: {
@remix-run/node”: “^2.12.1”,
@remix-run/react”: “^2.12.1”,
@remix-run/server-runtime”: “^2.12.1”,
@types/react”: “^18.2.20”,
@types/react-dom”: “^18.2.7”,
@typescript-eslint/eslint-plugin”: “^6.7.4”,
“eslint”: “^8.38.0”,
“eslint-config-prettier”: “^9.0.0”,
“eslint-import-resolver-typescript”: “^3.6.1”,
“eslint-plugin-import”: “^2.28.1”,
“eslint-plugin-jsx-a11y”: “^6.7.1”,
“eslint-plugin-react”: “^7.33.2”,
“eslint-plugin-react-hooks”: “^4.6.0”,
“tailwindcss”: “^3.4.1”,
“typescript”: “^5.1.6”
},
“engines”: {
“node”: “>=20.0.0”
}
}

I don’t see @remix-run/dev in your devDependencies. However, I came across Remix’s changelog referring to this – it looks like a fix was made: changelog#v241.

“avoid issues where @remix-run/dev could be inadvertently required in your server’s production dependencies”

Could you make sure you’re using @remix-run/dev@2.4.1 or greater in your devDependencies? Otherwise, without seeing the codebase itself, it will be quite challenging to determine what’s causing this error to crop up during deployment.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.