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

SyntaxError: missing ) after argument list error on SvelteKit example #10

Closed
hnrq opened this issue Aug 17, 2023 · 5 comments
Closed

SyntaxError: missing ) after argument list error on SvelteKit example #10

hnrq opened this issue Aug 17, 2023 · 5 comments

Comments

@hnrq
Copy link

hnrq commented Aug 17, 2023

When running any of the scripts below, the error: SyntaxError: missing ) after argument list pops up.
OS: Arch Linux
Node version: v18.16.0

{
	"name": "vercel",
	"version": "0.0.1",
	"private": true,
	"scripts": {
		"dev": "node -r dotenv/config ./node_modules/.bin/vite dev",
		"build": "node -r dotenv/config ./node_modules/.bin/vite build",
		"preview": "node -r dotenv/config ./node_modules/.bin/vite preview"
	},
	"devDependencies": {
		"@sveltejs/adapter-auto": "^2.1.0",
		"@sveltejs/kit": "^1.22.6",
		"svelte": "^4.2.0",
		"vite": "^4.4.9"
	},
	"type": "module",
	"dependencies": {
		"dotenv": "^16.3.1"
	}
}

Stack trace:

/home/dalborga/Workfolder/examples/svelte-kit/vercel/node_modules/.bin/vite:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1176:20)
    at Module._compile (node:internal/modules/cjs/loader:1218:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.16.0
@maxossnoser
Copy link

Same problem here with Angular.
OS: Windows
Node version: v18.16.0

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

SyntaxError: missing ) after argument list
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1176:20)
    at Module._compile (node:internal/modules/cjs/loader:1218:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.16.0

@yslinear
Copy link

I have a similar issue. I suspect that it's due to Node being unable to execute ./node_modules/.bin/vite dev

@yslinear
Copy link

yslinear commented Feb 1, 2024

motdotla/dotenv#801

Please review this; it might be helpful!

@motdotla
Copy link
Member

motdotla commented Feb 1, 2024

if you install dotenvx does that fix your issue?

npm install @dotenvx/dotenvx --save
{
	"name": "vercel",
	"version": "0.0.1",
	"private": true,
	"scripts": {
		"dev": "dotenvx run --verbose -- ./node_modules/.bin/vite dev",
		"build": "dotenvx run -- ./node_modules/.bin/vite build",
		"preview": "dotenvx run -- ./node_modules/.bin/vite preview"
	},
	"devDependencies": {
		"@sveltejs/adapter-auto": "^2.1.0",
		"@sveltejs/kit": "^1.22.6",
		"svelte": "^4.2.0",
		"vite": "^4.4.9"
	},
	"type": "module",
	"dependencies": {
		"@dotenvx/dotenvx": ""
	}
}

@hnrq
Copy link
Author

hnrq commented Oct 22, 2024

Coming back after a while to say that dotenvx works! Thanks, @motdotla

@hnrq hnrq closed this as completed Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants