Hi Everyone!
I’m trying to deploy a MERN app to Netlify but keep getting a 404. I’ve successfully deployed two React apps thus far so I’m not sure why this is happening considering the adjustments I’ve made. I’ve included a screenshot of the package.json file which is located in the root folder.
Also, for my previous deployments I included:
import { BrowserRouter } from ‘react-router-dom’;
ReactDOM.render(
,
document.getElementById(‘root’)
in the index.js because prior to doing this the site would load but there wasn’t any content. These are only React app’s, there isn’t a server.
I also did this for the current app’s index.js (in client) but got the following message when run locally:
ERROR
You cannot render a inside another . You should never have more than one in your app.
I’m not sure why this is happening but I’m going have the following instead because I don’t get any errors when run locally.
import * as serviceWorker from ‘./serviceWorker’;
ReactDOM.render(
<React.StrictMode>
</React.StrictMode>,
document.getElementById(‘root’)
);
serviceWorker.register();
Anyway, if someone could help me understand why I’m getting a 404 and why I’m getting the error message when I use the aforementioned code in client index.js and whether or not this is necessary for deployment on Netlify I would appreciate it.
Thanks,
Nick
Site link:
https://main--riddleriddlechickenliddle.netlify.app/
Deploy Log:
2:40:09 PM: build-image version: 310cc3c813338a2ca47a215a1ab6889dc6ff6cb7 (focal)
2:40:09 PM: buildbot version: d59e91ad7b9655bc2253d9308f8d23584a0c6ed8
2:40:09 PM: Building without cache
2:40:09 PM: Starting to prepare the repo for build
2:40:09 PM: No cached dependencies found. Cloning fresh repo
2:40:09 PM: git clone --filter=blob:none https://github.com/MogleyBear06/Bring-Me
2:40:10 PM: Preparing Git Reference refs/heads/main
2:40:17 PM: Starting to install dependencies
2:40:17 PM: Python version set to 3.8
2:40:18 PM: Attempting Ruby version 2.7.2, read from environment
2:40:18 PM: Using Ruby version 2.7.2
2:40:19 PM: Started restoring cached go cache
2:40:19 PM: Finished restoring cached go cache
2:40:19 PM: go version go1.19.11 linux/amd64
2:40:19 PM: Using PHP version 8.0
2:40:20 PM: v18.16.1 is already installed.
2:40:20 PM: Now using node v18.16.1 (npm v9.5.1)
2:40:20 PM: Enabling Node.js Corepack
2:40:20 PM: Started restoring cached build plugins
2:40:20 PM: Finished restoring cached build plugins
2:40:20 PM: Started restoring cached corepack dependencies
2:40:20 PM: Finished restoring cached corepack dependencies
2:40:20 PM: No npm workspaces detected
2:40:20 PM: Started restoring cached node modules
2:40:20 PM: Finished restoring cached node modules
2:40:21 PM: Installing npm packages using npm version 9.5.1
2:40:27 PM: > mern-shopping@1.0.0 install
2:40:27 PM: > cd server && npm i && cd …/client && npm i
2:40:29 PM: npm WARN deprecated multer@1.4.2: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
2:40:30 PM: npm WARN deprecated apollo-datasource@3.3.2: The apollo-datasource
package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). See Previous versions of Apollo Server - Apollo GraphQL Docs for more details.
2:40:30 PM: npm WARN deprecated apollo-server-types@3.8.0: The apollo-server-types
package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package’s functionality is now found in the @apollo/server
package. See Previous versions of Apollo Server - Apollo GraphQL Docs for more details.
npm WARN deprecated apollo-server-errors@3.3.1: The apollo-server-errors
package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package’s functionality is now found in the @apollo/server
package. See Previous versions of Apollo Server - Apollo GraphQL Docs for more details.
npm WARN deprecated apollo-server-plugin-base@3.7.2: The apollo-server-plugin-base
package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package’s functionality is now found in the @apollo/server
package. See Previous versions of Apollo Server - Apollo GraphQL Docs for more details.
npm WARN deprecated @types/bson@4.2.0: This is a stub types definition. bson provides its own type definitions, so you do not need this installed.
2:40:30 PM: npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
2:40:30 PM: npm WARN deprecated apollo-server-express@3.12.0: The apollo-server-express
package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package’s functionality is now found in the @apollo/server
package. See Previous versions of Apollo Server - Apollo GraphQL Docs for more details.
npm WARN deprecated apollo-server-env@4.2.1: The apollo-server-env
package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package’s functionality is now found in the @apollo/utils.fetcher
package. See Previous versions of Apollo Server - Apollo GraphQL Docs for more details.
npm WARN deprecated bcrypt@4.0.1: versions < v5.0.0 do not handle NUL in passwords properly
2:40:31 PM: npm WARN deprecated apollo-reporting-protobuf@3.4.0: The apollo-reporting-protobuf
package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package’s functionality is now found in the @apollo/usage-reporting-protobuf
package. See Previous versions of Apollo Server - Apollo GraphQL Docs for more details.
npm WARN deprecated apollo-server-core@3.12.0: The apollo-server-core
package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package’s functionality is now found in the @apollo/server
package. See Previous versions of Apollo Server - Apollo GraphQL Docs for more details.
2:40:31 PM: added 459 packages, and audited 460 packages in 4s
2:40:31 PM: 31 packages are looking for funding
2:40:31 PM: run npm fund
for details
2:40:31 PM: 11 vulnerabilities (7 moderate, 4 high)
2:40:31 PM: To address issues that do not require attention, run:
2:40:31 PM: npm audit fix
2:40:31 PM: To address all issues (including breaking changes), run:
2:40:31 PM: npm audit fix --force
2:40:31 PM: Run npm audit
for details.
2:40:35 PM: npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.
2:40:35 PM: npm WARN deprecated w3c-hr-time@1.0.2: Use your platform’s native performance.now() and performance.timeOrigin.
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: Array.prototype.sort() - JavaScript | MDN
2:40:35 PM: npm WARN deprecated source-map-url@0.4.1: See GitHub - lydell/source-map-url: [DEPRECATED] Tools for working with sourceMappingURL comments.
2:40:35 PM: npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
2:40:35 PM: npm WARN deprecated source-map-resolve@0.5.3: See GitHub - lydell/source-map-resolve: [DEPRECATED] Resolve the source map and/or sources for a generated file.
2:40:35 PM: npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
2:40:35 PM: npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.
2:40:36 PM: npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
2:40:39 PM: npm WARN deprecated @types/testing-library__dom@7.5.0: This is a stub types definition. testing-library__dom provides its own type definitions, so you do not need this installed.
2:40:40 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
2:40:44 PM: added 1388 packages, and audited 1389 packages in 12s
2:40:44 PM: 235 packages are looking for funding
2:40:44 PM: run npm fund
for details
2:40:44 PM: 6 high severity vulnerabilities
2:40:44 PM: To address all issues (including breaking changes), run:
2:40:44 PM: npm audit fix --force
2:40:44 PM: Run npm audit
for details.
2:40:44 PM: added 60 packages, and audited 61 packages in 23s
2:40:44 PM: 5 packages are looking for funding
2:40:44 PM: run npm fund
for details
2:40:44 PM: found 0 vulnerabilities
2:40:44 PM: npm packages installed
2:40:44 PM: Install dependencies script success
2:40:44 PM: No build steps found, continuing to publishing
2:40:45 PM: Starting to deploy site from ‘/’
2:40:46 PM: Calculating files to upload
2:40:57 PM: Starting post processing
2:40:57 PM: Skipping HTML post processing
2:40:57 PM: Post processing - header rules
2:40:57 PM: Post processing - redirect rules
2:40:58 PM: Post processing done
2:40:58 PM: Section completed: postprocessing
2:41:03 PM: Site is live
2:41:03 PM: 0 new files to upload
2:41:03 PM: 0 new functions to upload
2:41:03 PM: Section completed: deploying
2:41:03 PM: Section completed: building
2:41:05 PM: Uploading Cache of size 125.4MB
2:41:07 PM: Section completed: cleanup
2:41:07 PM: Finished processing build request in 57.753s