jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.38k stars 1.16k forks source link

SyntaxError: Identifier '__vite__injectQuery' has already been declared (at ${mod.id}:57205:1) #1439

Open Pedro-Laurenti opened 2 weeks ago

Pedro-Laurenti commented 2 weeks ago

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 'viteinjectQuery' 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