language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Antigravity Svelte Extension Compatibility

Open andremacola opened this issue 1 month ago • 19 comments

Describe the bug

There is an error with the Google Antigravity editor

Error in svelte.config.js

Error: Cannot find module @rollup/rollup-darwin-arm64. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.

Reproduction

  • Install the new Google Antigravity editor
  • Install svelte extension
  • Open any svelte file

Expected behaviour

No error in @rollup/rollup-darwin-arm64

System Info

  • OS: MacOSX Sequoia
  • IDE: Google Antigravity 1.11.3

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

andremacola avatar Nov 19 '25 20:11 andremacola

This is typically because your dependencies are installed under an x64 environment(Rosetta), but your editor is running in Apple Silicon arm64. If it's really related to the editor. The error message would say it can't find the corresponding packaging for another architecture. You should check if the terminal app or the Node.js version manager you were using is running under Roesttea. You can see the discussion in #2278 for pointers.

jasonlyu123 avatar Nov 20 '25 00:11 jasonlyu123

This is typically because your dependencies are installed under an x64 environment(Rosetta), but your editor is running in Apple Silicon arm64. If it's really related to the editor. The error message would say it can't find the corresponding packaging for another architecture. You should check if the terminal app or the Node.js version manager you were using is running under Roesttea. You can see the discussion in #2278 for pointers.

Rosetta is not in use. Not that I'm aware of

This issue occurs specifically with Antigravity. Other applications like VSCode, Cursor, and Windsurf are functioning correctly.

andremacola avatar Nov 20 '25 02:11 andremacola

@rollup/rollup-darwin-arm64 is the correct package for your OS. Can you check if the package is actually in your node_modules? If not, what is the package in the @rollup directory?

To be clear, there isn't really a thing we can "fix". This is a runtime error that comes from your svelte.config.js. And it's because of your preprocess setup. What I can do is help you find the problem with your setup.

jasonlyu123 avatar Nov 20 '25 02:11 jasonlyu123

I don't have any @rollup package in first level of node_modules

I think that's Antigravity Editor bug.

Image

Package.json

{
  "name": "dashboard",
  "private": true,
  "version": "0.0.1",
  "type": "module",
  "scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "preview": "vite preview",
    "prepare": "svelte-kit sync || echo ''",
    "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
    "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
    "format": "prettier --write .",
    "lint": "prettier --check . && eslint ."
  },
  "devDependencies": {
    "@eslint/compat": "^1.4.0",
    "@eslint/js": "^9.38.0",
    "@internationalized/date": "^3.10.0",
    "@lucide/svelte": "^0.554.0",
    "@sveltejs/adapter-auto": "^7.0.0",
    "@sveltejs/kit": "^2.47.1",
    "@sveltejs/vite-plugin-svelte": "^6.2.1",
    "@tailwindcss/forms": "^0.5.10",
    "@tailwindcss/typography": "^0.5.19",
    "@tailwindcss/vite": "^4.1.14",
    "@tanstack/table-core": "^8.21.3",
    "@types/d3-scale": "^4.0.9",
    "@types/node": "^24",
    "bits-ui": "^2.14.3",
    "clsx": "^2.1.1",
    "d3-scale": "^4.0.2",
    "embla-carousel-svelte": "^8.6.0",
    "eslint": "^9.38.0",
    "eslint-config-prettier": "^10.1.8",
    "eslint-plugin-prettier": "^5.5.4",
    "eslint-plugin-svelte": "^3.12.4",
    "formsnap": "^2.0.1",
    "globals": "^16.4.0",
    "layerchart": "2.0.0-next.27",
    "mode-watcher": "^1.1.0",
    "paneforge": "^1.0.2",
    "prettier": "^3.6.2",
    "prettier-plugin-svelte": "^3.4.0",
    "prettier-plugin-tailwindcss": "^0.7.1",
    "svelte": "^5.41.0",
    "svelte-check": "^4.3.3",
    "svelte-sonner": "^1.0.6",
    "sveltekit-superforms": "^2.28.1",
    "tailwind-merge": "^3.4.0",
    "tailwind-variants": "^3.1.1",
    "tailwindcss": "^4.1.14",
    "tw-animate-css": "^1.4.0",
    "typescript": "^5.9.3",
    "typescript-eslint": "^8.46.1",
    "vaul-svelte": "1.0.0-next.7",
    "vite": "^7.1.10",
    "vite-plugin-devtools-json": "^1.0.0"
  }
}

andremacola avatar Nov 20 '25 03:11 andremacola

It's not a direct dependency. So if you're using pnpm, it should be under node_modules/.pnpm

jasonlyu123 avatar Nov 20 '25 03:11 jasonlyu123

Sorry, I forgot about pnpm.

I think It's the correct package.

@[email protected]

andremacola avatar Nov 20 '25 03:11 andremacola

I added this setting to the settings.json, and the issue was resolved. { "svelte.language-server.runtime": "node", "svelte.plugin.svelte.compilerWarnings": { "a11y-media-has-caption": "ignore" } }

brucesong08 avatar Nov 21 '25 04:11 brucesong08

I added this setting to the settings.json, and the issue was resolved. { "svelte.language-server.runtime": "node", "svelte.plugin.svelte.compilerWarnings": { "a11y-media-has-caption": "ignore" } }

Nice, "svelte.language-server.runtime": "node" apparently fix the problem.

andremacola avatar Nov 21 '25 04:11 andremacola

@brucesong08 Were you also only having the issue in Antigravity? Do you have the @rollup/rollup-darwin-arm64 package in your node_modules? Or maybe it actually is @rollup/rollup-darwin-x64?

jasonlyu123 avatar Nov 21 '25 08:11 jasonlyu123

@brucesong08 Were you also only having the issue in Antigravity? Do you have the @rollup/rollup-darwin-arm64 package in your node_modules? Or maybe it actually is @rollup/rollup-darwin-x64?

Yes, I'm sure the package is correct, and I've checked the node-modules/@rollup directory. The same project works fine on Windsurf.

brucesong08 avatar Nov 21 '25 09:11 brucesong08

@andremacola Where did you add this line? I don't have a settings.json file so created a new settings.json file at the root of the project and added this json config there, but the error is still there. I'm also using Antigravity editor and facing this issue in this editor only rest works fine.

.vscode/settings.json

here is my

{
  "editor.rulers": [
    100,
    120,
    140
  ],
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  },
  "eslint.validate": [
    "javascript",
    "typescript",
    "svelte"
  ],
  "typescript.format.enable": false,
  "javascript.format.enable": false,
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "svelte.language-server.runtime": "node",
  "[svelte]": {
    "editor.defaultFormatter": "svelte.svelte-vscode",
    "editor.formatOnSave": true
  }
}

andremacola avatar Nov 21 '25 15:11 andremacola

Ok, I borrowed a MacBook to debug the problem, and I can reproduce the error. The underlying error is "not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?" This seems to be a Mac-only security measurement that prevents the Node.js version bundled in Antigravity from loading the rollup binary.

To workaround this, as mentioned by brucesong08, you can use the svelte.language-server.runtime config to use your own Node.js installation. Or if you aren't using vitePreprocess, you could also try to remove it from svelte.config.js.

Using dynamic-import to load vite-preprocess conditionally might also be a solution if you're not using style preprocess:

let vitePreprocess;
try {	
	vitePreprocess = await import('@sveltejs/vite-plugin-svelte').then((m) => m.vitePreprocess);
} catch (error) {
	
}

/** @type {import('@sveltejs/kit').Config} */
const config = {
	// Consult https://svelte.dev/docs/kit/integrations
	// for more information about preprocessors
	preprocess: vitePreprocess?.(),
}

jasonlyu123 avatar Nov 21 '25 16:11 jasonlyu123

apparently something's going on at gemini-cli too

Image

andremacola avatar Nov 22 '25 02:11 andremacola

Having the issue too, seem to be the Antigravity issue

7haveeen avatar Dec 01 '25 11:12 7haveeen

Same situation (Antigravity, arm64 architecture, nvm, tried node 20), but "svelte.language-server.runtime": "node" doesn't work for me. I have @rollup/rollup-darwin-arm64 in node_modules.

edit: node 24 worked, after npm update and restarting antigravity 🎉

EskelCz avatar Dec 06 '25 13:12 EskelCz

You will need to restart the editor if you changed the svelte.language-server.runtime config.

jasonlyu123 avatar Dec 06 '25 13:12 jasonlyu123

TT Please see this issue @AntigravityTeamGoogle

jijiseong avatar Dec 10 '25 16:12 jijiseong

That still did not fix it for me Only occurs in Antigravity, fine is VSCode + Cursor

Setup:

  • M3 Pro
  • npm 11.7.0
  • node 22.17.1
  • .vscode/settings.json: { "files.associations": { "*.css": "tailwindcss" }, "editor.rulers": [ 100, 120, 140 ], "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, "eslint.validate": [ "javascript", "typescript", "svelte" ], "typescript.format.enable": false, "javascript.format.enable": false, "[json]": { "editor.defaultFormatter": "vscode.json-language-features" }, "svelte.language-server.runtime": "node", "[svelte]": { "editor.defaultFormatter": "svelte.svelte-vscode", "editor.formatOnSave": true } }

What I tried:

  • delete node_modules + package-lock.json
  • tried npm i rollup/rollup-darwin-arm64
  • tried npm cache clean --force
  • tried npm update
  • upgrading to node v24 as another user suggested and re-ran all steps

After each change:

  • tried restarting Svelte Language Server
  • tried restarting the Antigravity editor

Did all of those steps in any combination of order possible, still no luck.

bisco-dev avatar Dec 10 '25 21:12 bisco-dev

By chance I solved issue somehow;

I uninstalled the Svelte for VS Code extension in Antigravity and reinstalled after having enabled Node v24

bisco-dev avatar Dec 10 '25 21:12 bisco-dev

I added this setting to the settings.json, and the issue was resolved. { "svelte.language-server.runtime": "node", "svelte.plugin.svelte.compilerWarnings": { "a11y-media-has-caption": "ignore" } }

Nice, "svelte.language-server.runtime": "node" apparently fix the problem.

Works for me, thank you

taogaetz avatar Dec 18 '25 16:12 taogaetz

I added this setting to the settings.json, and the issue was resolved. { "svelte.language-server.runtime": "node", "svelte.plugin.svelte.compilerWarnings": { "a11y-media-has-caption": "ignore" } }

"svelte.language-server.runtime": "node" this works for me too, thanks

SourceKim avatar Dec 21 '25 07:12 SourceKim