facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.46k stars 26.77k forks source link

SyntaxError: Unexpected token '<' #11115

Open NorthenIrbis opened 3 years ago

NorthenIrbis commented 3 years ago

Hi!

NorthenIrbis commented 3 years ago

Hi! I got error

nodejs_1  | file:///opt/project/src/index.js:27
nodejs_1  |   <Provider store={store}>
nodejs_1  |   ^
nodejs_1  | 
nodejs_1  | SyntaxError: Unexpected token '<'
nodejs_1  |     at Loader.moduleStrategy (internal/modules/esm/translators.js:117:18)
nodejs_1  |     at async link (internal/modules/esm/module_job.js:42:21)

the babel-preset-react-app was installed https://github.com/facebook/create-react-app

my .babelrc { "presets": ["react-app"] }

NorthenIrbis commented 3 years ago

package.json { "name": "@devias-io/material-kit-pro-react", "type": "module", "author": "DeviasIO", "email": "contact@devias.io", "licence": "UNLICENSED", "version": "2.0.0", "private": true, "scripts": { "lint": "eslint ./src", "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "browserslist": { "production": [ ">0.2%", "ie 11", "not dead", "not op_mini all" ], "development": [ "ie 11", "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "dependencies": { "@date-io/core": "^2.10.6", "@date-io/moment": "^1.3.13", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.56", "@material-ui/pickers": "^3.2.10", "@material-ui/styles": "^4.10.0", "@mdx-js/react": "^1.6.19", "@react-pdf/renderer": "^1.6.11", "axios": "^0.21.1", "axios-mock-adapter": "^1.19.0", "change-case": "^4.1.1", "chart.js": "^2.9.4", "clsx": "^1.1.1", "dotenv": "^8.2.0", "draft-js": "^0.11.7", "formik": "^2.2.1", "history": "^4.10.1", "immer": "^6.0.9", "immutable": "^4.0.0-rc.12", "js-cookie": "^2.2.1", "jsonwebtoken": "^8.5.1", "jss": "^10.4.0", "jss-rtl": "^0.3.0", "jwt-decode": "^2.2.0", "lodash": "^4.17.21", "moment": "^2.29.1", "notistack": "^0.9.17", "nprogress": "^0.2.0", "prismjs": "^1.23.0", "prop-types": "^15.7.2", "react": "^16.14.0", "react-app-polyfill": "^1.0.6", "react-beautiful-dnd": "^13.0.0", "react-big-calendar": "^0.24.6", "react-chartjs-2": "^2.10.0", "react-dom": "^16.14.0", "react-draft-wysiwyg": "^1.14.7", "react-dropzone": "^10.2.2", "react-feather": "^2.0.8", "react-helmet": "^5.2.1", "react-markdown": "^4.3.1", "react-modal-image": "^2.5.0", "react-perfect-scrollbar": "^1.5.8", "react-quill": "^1.3.5", "react-redux": "^7.2.2", "react-router": "^5.2.0", "react-router-dom": "^5.2.0", "react-scripts": "^3.4.4", "redux": "^4.0.5", "redux-devtools-extension": "^2.13.8", "redux-form": "^8.3.6", "redux-logger": "^3.0.6", "redux-thunk": "^2.3.0", "uuid": "^7.0.3", "yup": "^0.28.5" }, "devDependencies": { "babel-preset-react-app": "^10.0.0", "eslint": "^6.8.0", "eslint-config-airbnb": "^18.2.0", "eslint-config-prettier": "^6.15.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-mdx": "^1.8.2", "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-react": "^7.21.5", "eslint-plugin-react-hooks": "^2.5.1", "mdx-loader": "^3.0.2", "prettier": "^1.19.1", "typescript": "^3.9.7" } }

NorthenIrbis commented 3 years ago

index.js

import 'react-app-polyfill/ie11'; import 'react-app-polyfill/stable'; import 'react-perfect-scrollbar/dist/css/styles.css'; import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css'; import 'react-quill/dist/quill.snow.css'; import 'nprogress/nprogress.css'; import 'src/assets/css/prism.css'; import 'src/mixins/chartjs'; import 'src/mixins/prismjs'; //import 'src/mock'; import { enableES5 } from 'immer'; import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import * as serviceWorker from 'src/serviceWorker'; import { SettingsProvider } from 'src/context/SettingsContext'; import { configureStore } from 'src/store'; import { restoreSettings } from 'src/utils/settings'; import App from 'src/App'; require('dotenv').config(); enableES5();

const store = configureStore(); const settings = restoreSettings();

ReactDOM.render(

, document.getElementById('root') ); serviceWorker.unregister();
NorthenIrbis commented 3 years ago

Could you help me?

GNSubrahmanyam commented 3 years ago

@NorthenIrbis Can you share your sample project so that i can help you.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.