Open luml opened 3 years ago
6:16:44 PM: $ npm run build 6:16:44 PM: > adoptmev2@1.0.0 build /opt/build/repo 6:16:44 PM: > NODE_ENV=production parcel build src/index.html 6:17:03 PM: 🚨 /opt/build/repo/src/App.js:5:20: Cannot resolve dependency './Details' at '/opt/build/repo/src/Details' 6:17:03 PM: 3 | import { BrowserRouter as Router, Route, Switch, Link } from "react-router-dom"; 6:17:03 PM: 4 | import SearchParams from "./SearchParams"; 6:17:03 PM: > 5 | import Details from "./Details"; 6:17:03 PM: | ^ 6:17:03 PM: 6 | import Menu from "./Menu"; 6:17:03 PM: 7 | import Home from "./Home"; 6:17:03 PM: 8 | import About from "./About"; 6:17:04 PM: npm ERR! code ELIFECYCLE
And, it is perfectly fine to build on local environment. Appreciate any tips why got an build error on Netlify.
Netlify doesn't use "Node Environment". I guess the errors are coming because of it. You have to do some other things to use Node environment in Netlify.
Suggestion: Use Github pages
6:16:44 PM: $ npm run build 6:16:44 PM: > adoptmev2@1.0.0 build /opt/build/repo 6:16:44 PM: > NODE_ENV=production parcel build src/index.html 6:17:03 PM: 🚨 /opt/build/repo/src/App.js:5:20: Cannot resolve dependency './Details' at '/opt/build/repo/src/Details' 6:17:03 PM: 3 | import { BrowserRouter as Router, Route, Switch, Link } from "react-router-dom"; 6:17:03 PM: 4 | import SearchParams from "./SearchParams"; 6:17:03 PM: > 5 | import Details from "./Details"; 6:17:03 PM: | ^ 6:17:03 PM: 6 | import Menu from "./Menu"; 6:17:03 PM: 7 | import Home from "./Home"; 6:17:03 PM: 8 | import About from "./About"; 6:17:04 PM: npm ERR! code ELIFECYCLE
And, it is perfectly fine to build on local environment. Appreciate any tips why got an build error on Netlify.