HamishMW / portfolio

My personal portfolio website built using React and three js

Home Page:https://hamishw.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I deploy this on Netlify/Vercel?

mayankjain25 opened this issue · comments

Having the same problem. Seems like deploying to vercel is a lot harder

image

image

This was simply not deployable on Vercel.
Had to switch to Netlify instead. Do note that there were a LOT of ESLint errors that were generated in the process. My suggestion would be to turn it off to avoid some of the warnings that hamper the build process.

This was simply not deployable on Vercel. Had to switch to Netlify instead. Do note that there were a LOT of ESLint errors that were generated in the process. My suggestion would be to turn it off to avoid some of the warnings that hamper the build process.

What makes netlify so different? Im trying to deploy on amazon using AWS Amplify but there is still the same/similar error during building process. ChatGPT said it has something to do with --no-sandbox mode but i'm having the same error regardless.

Have you had the similar error logs and what have you changed to fix them?

I just switched to Netlify when Vercel wasn't working. Fixed all the errors that came along the way, most were warnings rather than errors.

On Thu, 30 Mar, 2023, 2:47 am Milan Obrenovic, @.> wrote: This was simply not deployable on Vercel. Had to switch to Netlify instead. Do note that there were a LOT of ESLint errors that were generated in the process. My suggestion would be to turn it off to avoid some of the warnings that hamper the build process. What makes netlify so different? Im trying to deploy on amazon using AWS Amplify but there is still the same/similar error during building process. ChatGPT said it has something to do with --no-sandbox mode but i'm having the same error regardless. Have you had the similar error logs and what have you changed to fix them? — Reply to this email directly, view it on GitHub <#50 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATL3IXRQ247GCAUXUQOYV5TW6SRGBANCNFSM6AAAAAATLP4YQU . You are receiving this because you authored the thread.Message ID: @.>

I just did it, the site can be deployed via Amazon AWS Amplify (easiest method)

For anyone having issues with deployign with nelify, here is a quick solution

creat a file on the root folder called netlify.toml

and add this

[build]
publish = "out"

[build.environment]
NETLIFY_NEXT_PLUGIN_SKIP = "true"

[[plugins]]
package = "@netlify/plugin-functions-install-core"

When deploying on netlify, change the output folder from .next to out and you should be good

I just switched to Netlify when Vercel wasn't working. Fixed all the errors that came along the way, most were warnings rather than errors.

On Thu, 30 Mar, 2023, 2:47 am Milan Obrenovic, @.> wrote: This was simply not deployable on Vercel. Had to switch to Netlify instead. Do note that there were a LOT of ESLint errors that were generated in the process. My suggestion would be to turn it off to avoid some of the warnings that hamper the build process. What makes netlify so different? Im trying to deploy on amazon using AWS Amplify but there is still the same/similar error during building process. ChatGPT said it has something to do with --no-sandbox mode but i'm having the same error regardless. Have you had the similar error logs and what have you changed to fix them? — Reply to this email directly, view it on GitHub <#50 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATL3IXRQ247GCAUXUQOYV5TW6SRGBANCNFSM6AAAAAATLP4YQU . You are receiving this because you authored the thread.Message ID: _@**.**_>

I just did it, the site can be deployed via Amazon AWS Amplify (easiest method)

Could you share some of the settings you used inside of AWS to have it fully functional? I ran the deploy command and it uploadded to my S3 Bucket but I am a bit lost into what to do now.

Forget about netlify or vercel just create a github workflow under the folder https://github.com/Tresillo2017/portfolio-1/blob/master/.github/workflows/nextjs.yml like that.

For anyone having issues to deploy on Vercel because running as root without --no-sandboox is not supported. What you need to do in the og-image.js file you should pass --no-sandbox as arguments to the browser variable .This disables sandboxing in environments where sandboxing is restricted.

const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox'] });

`[build]
command = "npm run build"
publish = "/build"
base = "/"

Rewrite API requests to actual location of serverless functions

[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200

Catch all other requests that don't match a file or API route

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[[plugins]]
package = "@netlify/plugin-functions-install-core"`
Use this code in your netlify.toml and just deploy on netlify

commented

Forget about netlify or vercel just create a github workflow under the folder https://github.com/Tresillo2017/portfolio-1/blob/master/.github/workflows/nextjs.yml like that.

Thank you very much! I deploy the website successfully in this method. For someone who never use github to deploy, remember go to project setting, enable this:
image

For anyone having prerendering issues with mdx files on Vercel or any linux based services, you can try to install libgbm-dev and libasound2

sudo apt-get update sudo apt-get install -y libgbm-dev sudo apt-get install libasound2

Anyone figure out how to publish with netlify yet?

Can someone guide me on how to deploy on Vercel, I get
`file:///var/task/build/server/nodejs-eyJydW50aW1lIjoibm9kZWpzIn0/assets/server-build-C2V4WFnV.js:4
import { renderToReadableStream } from "react-dom/server";
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'renderToReadableStream' not found. The requested module 'react-dom/server' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'react-dom/server';
const { renderToReadableStream } = pkg;

at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async c (/var/task/___vc/__launcher/bridge-server-BGIDXK2J.js:2:3579)

INIT_REPORT Init Duration: 833.46 ms Phase: invoke Status: error Error Type: Runtime.ExitError
Error: Runtime exited with error: exit status 1`