Oldweb2 Blog

← Back to blog index, Posted February 2nd 2022

Common issues in Remix.Run

Error when using dotenv on Windows

Update: This might no longer be a problem since Remix now has .env file support.

Problem: Can't start the project with remix dev

You get the error below:

basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

SyntaxError: missing ) after argument list
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

Solution: Modify package.json

Edit the line "dev": "node -r dotenv/config node_modules/.bin/remix dev", to read "dev": "node -r dotenv/config ./node_modules/@remix-run/dev/cli.js",

Please consider sharing this article if you found it useful!