mi aplicación se estaba ejecutando en localhost:3000 hace unos momentos sin ningún problema, ahora de repente recibo el error:
Module not found: Can't resolve './App' in '/my/path/etc/...'
Esto está sucediendo en mi archivo index.js
import React from "react"; import ReactDOM from "react-dom"; import "./index.css"; import App from "./App"; import reportWebVitals from "./reportWebVitals"; import TimeAgo from "javascript-time-ago"; import { FirebaseAppProvider } from "reactfire"; import en from "javascript-time-ago/locale/en"; TimeAgo.addDefaultLocale(en); const firebaseConfig = { //MY FIREBASE CONFIG }; ReactDOM.render( <React.StrictMode> <FirebaseAppProvider firebaseConfig={firebaseConfig}> <App /> </FirebaseAppProvider> </React.StrictMode>, document.getElementById("root") ); // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. reportWebVitals();Mi estructura de archivos se ve así:
Si cambio la importación en mi archivo de índice de
import App from "./App";
a
import App from "./App.tsx";
Se compila, sin embargo, aparece un error diferente:
InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/App.2d194585.tsx') is not a valid name.
EDITAR 1 (Configuración ts agregada):
{ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "baseUrl": "./src" }, "include": ["src"] }