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

Bug: Failed to run [email protected] on latest version of vite. #831

Open
lynhan318 opened this issue Feb 18, 2025 · 2 comments
Open

Bug: Failed to run [email protected] on latest version of vite. #831

lynhan318 opened this issue Feb 18, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@lynhan318
Copy link

Describe the bug

Hi,
I'm use svelte with the latest version of vite(6.1.0). Failed to start the project with following errors:

[plugin:vite:worker-import-meta-url] Expected ';', '}' or <eof>
@xmtp+wasm-bindings@0.0.13/node_modules/@xmtp/wasm-bindings/dist/snippets/sqlite-web-90f8afa7b0cd2303/src/js/sqlite3-diesel.js:1:168

Here is my vite.config.ts:

import path from 'node:path';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vite';
// https://vite.dev/config/
export default defineConfig({
  optimizeDeps: {
    exclude: ['@xmtp/browser-sdk', '@xmtp/wasm-bindings'],
    include: ['@xmtp/proto'],
  },
  plugins: [tailwindcss(), svelte()],
  resolve: {
    alias: {
      $lib: path.resolve(__dirname, 'src/lib'),
    },
  },
});

Expected behavior

Image

Steps to reproduce the bug

No response

@lynhan318 lynhan318 added the bug Something isn't working label Feb 18, 2025
@rygine
Copy link
Collaborator

rygine commented Feb 18, 2025

hey @lynhan318, thanks for the detailed report!

in your vite.config.ts, try changing the optimizeDeps config to this:

  optimizeDeps: {
    exclude: ["@xmtp/wasm-bindings"],
  },

@lynhan318
Copy link
Author

Hey @rygine ,

Thank for the response. I attempted the suggested solution, the resulted in the same error.

This is my package.json dependencies:

	"devDependencies": {
		"@sveltejs/adapter-auto": "^4.0.0",
		"@sveltejs/kit": "^2.16.0",
		"@sveltejs/vite-plugin-svelte": "^5.0.0",
		"svelte": "^5.0.0",
		"svelte-check": "^4.0.0",
		"typescript": "^5.0.0",
		"vite": "^6.0.0"
	},
	"pnpm": {
		"onlyBuiltDependencies": ["esbuild"]
	},
	"dependencies": {
		"@xmtp/browser-sdk": "^0.0.18",
		"@xmtp/proto": "^3.74.0",
		"@xmtp/wasm-bindings": "^0.0.14",
		"buffer": "^6.0.3"
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants