Description
fetch-worker.7a0adc94df277ffeb963.js:1 Uncaught SyntaxError: Unexpected token '<' (at fetch-worker.7a0adc94df277ffeb963.js:1:1)
My scratchEditor file looks like this:
`
import React, { useEffect, useState } from "react";
import { Provider, useSelector } from "react-redux";
import { IntlProvider } from "react-intl";
import { store, scratchGUI } from "../stores/store"; // Import store and scratchGUI
const ScratchApp = () => {
const [WrappedGUI, setWrappedGUI] = useState(null);
useEffect(() => {
// Only initialize scratch-gui if it's available
if (scratchGUI) {
const { AppStateHOC, default: GUI } = scratchGUI;
if (AppStateHOC && GUI) {
const Wrapped = AppStateHOC(GUI); // Wrap the GUI with AppStateHOC
setWrappedGUI(() => Wrapped); // Set the wrapped GUI component
}
}
}, []);
// If the GUI is not loaded yet, show a loading message
if (!WrappedGUI) {
return
}
const locale = useSelector((state) => state.locales.locale || "en"); // Get locale from Redux state
const messages = useSelector((state) => state.locales.messages || {}); // Get messages from Redux state
return (
{" "}
{/* Provide the Redux store to the app /}
<div style={{ width: "100vw", height: "100vh" }}>
{/ Render the wrapped Scratch GUI */}
);
};
export default ScratchApp;
`