timlrx / tailwind-nextjs-starter-blog

This is a Next.js, Tailwind CSS blogging starter template. Comes out of the box configured with the latest technologies to make technical writing a breeze. Easily configurable and customizable. Perfect as a replacement to existing Jekyll and Hugo individual blogs.
https://tailwind-nextjs-starter-blog.vercel.app/
MIT License
8.53k stars 1.97k forks source link

EmailOctopus works fine in local but not when deployed #992

Closed Saugatkafley closed 6 hours ago

Saugatkafley commented 1 month ago

Describe the bug EmailOctopus works fine on local but when i deploy app on saugatkafley.com.np. There is 405 error

To Reproduce Steps to reproduce the behavior:

  1. Go to 'newsletter signup'
  2. Enter an email address
  3. Submit
  4. On Networks > Newsletter

Expected behavior sends

Screenshots image

System Info (if dev / build issue):

Package.json

{
  "name": "tailwind-nextjs-starter-blog",
  "version": "2.2.0",
  "private": true,
  "scripts": {
    "start": "next dev",
    "dev": "cross-env INIT_CWD=$PWD next dev",
    "build": "cross-env INIT_CWD=$PWD next build && cross-env NODE_OPTIONS='--experimental-json-modules' node ./scripts/postbuild.mjs",
    "serve": "next start",
    "analyze": "cross-env ANALYZE=true next build",
    "lint": "next lint --fix --dir pages --dir app --dir components --dir lib --dir layouts --dir scripts",
    "prepare": "husky"
  },
  "dependencies": {
    "@headlessui/react": "1.7.19",
    "@next/bundle-analyzer": "14.2.3",
    "@tailwindcss/forms": "^0.5.7",
    "@tailwindcss/typography": "^0.5.12",
    "autoprefixer": "^10.4.13",
    "contentlayer2": "0.4.6",
    "esbuild": "0.20.2",
    "github-slugger": "^2.0.0",
    "gray-matter": "^4.0.2",
    "hast-util-from-html-isomorphic": "^2.0.0",
    "image-size": "1.0.0",
    "next": "14.2.3",
    "next-contentlayer2": "0.4.6",
    "next-themes": "^0.3.0",
    "nextjs-google-analytics": "^2.3.3",
    "pliny": "0.2.1",
    "postcss": "^8.4.24",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "reading-time": "1.5.0",
    "rehype-autolink-headings": "^7.1.0",
    "rehype-citation": "^2.0.0",
    "rehype-katex": "^7.0.0",
    "rehype-preset-minify": "7.0.0",
    "rehype-prism-plus": "^2.0.0",
    "rehype-slug": "^6.0.0",
    "remark": "^15.0.0",
    "remark-gfm": "^4.0.0",
    "remark-github-blockquote-alert": "^1.2.1",
    "remark-math": "^6.0.0",
    "sharp": "^0.33.4",
    "tailwindcss": "^3.4.3",
    "typescript": "^5.5.4",
    "unist-util-visit": "^5.0.0"
  },
  "devDependencies": {
    "@svgr/webpack": "^8.0.1",
    "@types/mdx": "^2.0.12",
    "@types/react": "17.0.52",
    "@typescript-eslint/eslint-plugin": "^6.1.0",
    "@typescript-eslint/parser": "^5.0.1",
    "cross-env": "^7.0.3",
    "eslint": "^8.52.0",
    "eslint-config-next": "14.2.3",
    "eslint-config-prettier": "^8.8.0",
    "eslint-plugin-prettier": "^5.0.0",
    "husky": "^9.0.0",
    "lint-staged": "^13.0.0",
    "prettier": "^3.1.0",
    "prettier-plugin-tailwindcss": "^0.6.5"
  },
  "lint-staged": {
    "*.+(js|jsx|ts|tsx)": [
      "eslint --fix"
    ],
    "*.+(js|jsx|ts|tsx|json|css|md|mdx)": [
      "prettier --write"
    ]
  },
  "packageManager": "yarn@3.6.1",
  "overrides": {
    "uri-js": "npm:uri-js-replace"
  }
}
Saugatkafley commented 1 month ago

Is this CSP related problem? I also added emailoctopus.com on next.config.js

const ContentSecurityPolicy = `
  default-src 'self';
  script-src 'self' 'unsafe-eval' 'unsafe-inline' giscus.app analytics.umami.is us.umami.is cloud.umami.is emailoctopus.com;
  style-src 'self' 'unsafe-inline';
  img-src * blob: data:;
  media-src *.s3.amazonaws.com;
  connect-src * ;
  font-src 'self';
  frame-src giscus.app
`
timlrx commented 1 month ago

How are you deploying? Can you check that you have correctly set the environment variable in the deployment server? I have double check the integration and it seems to work without issues.