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: Identifier '__vite__injectQuery' has already been declared (at ${mod.id}:57205:1) #1439

Open
Pedro-Laurenti opened this issue Jun 18, 2024 · 0 comments

Comments

@Pedro-Laurenti
Copy link

Pedro-Laurenti commented Jun 18, 2024

this method dont work in my project (vite electron app):

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  define: {
    global: 'window',
  },
  build: {
    rollupOptions: {
      external: ['graphql'],
    },
  },
});

_Originally posted by @HannahNguyen6729 in https://github.com/jpuri/react-draft-wysiwyg/issues/1317#issuecomment-1652085974_

error code:

SyntaxError: Identifier '__vite__injectQuery' has already been declared

im pasting it in the "main.jsx":

import './assets/main.css'

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'

ReactDOM
    .createRoot(document.getElementById('root'))
    .render(
        <div id="pdfContent">
            <App/>
        </div>
    )

import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
    plugins: [react()],
    define: {
        global: 'window'
    },
    build: {
        rollupOptions: {
            external: ['graphql']
        }
    }
});

project filetree:

formrelat/
┣ resources/
┣ src/
┃ ┣ main/
┃ ┃ ┗ index.js
┃ ┣ preload/
┃ ┃ ┗ index.js
┃ ┗ renderer/
┃ ┣ src/
┃ ┃ ┃ ┣ assets/
┃ ┃ ┃ ┣ components/
┃ ┃ ┃ ┃ ┣ Form.jsx
┃ ┃ ┃ ┃ ┣ FormComponents.tsx
┃ ┃ ┃ ┃ ┣ SelectPage.jsx
┃ ┃ ┃ ┃ ┗ TittleForm.jsx
┃ ┃ ┃ ┣ img/
┃ ┃ ┃ ┃ ┗ icon.png
┃ ┃ ┃ ┣ App.jsx
┃ ┃ ┃ ┣ FormPage.jsx
┃ ┃ ┃ ┗ main.jsx (HERE)
┃ ┣ index.html
┗ package.json

@Pedro-Laurenti Pedro-Laurenti changed the title But not work... SyntaxError: Identifier '__vite__injectQuery' has already been declared (at ${mod.id}:57205:1) Jun 18, 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

1 participant