sofn-xyz/mailing

`npx mailing` crashes on node 14

psugihara opened this issue · 2 comments

Describe the bug
npx mailing crashes on node 14

To Reproduce

package.json

{
    "dependencies": {
      "mailing-core": "^0.9.4",
      "next": "^13.0.6",
      "react": "^18.2.0",
      "react-dom": "^18.2.0"
    },
    "devDependencies": {
      "mailing": "^0.9.4"
    }
  }

.tool-versions

nodejs 14.18.1

run

yarn
npx mailing --typescript

Expected behavior
It should work.

Actual behaviour

yarn run v1.22.19
warning package.json: No license field
$ /Users/petersugihara/mailing-next-level33/node_modules/.bin/mailing
mailing starting preview server
mailing scanning for previews at ./emails/previews [
  'AccountCreated.tsx',
  'NewSignIn.tsx',
  'Reservation.tsx',
  'ResetPassword.tsx'
]
mailing linting templates in ./emails...
event - compiled client and server successfully in 620 ms (310 modules)
mailing watching for changes to emails
mailing init

initialize mailing in your app

Commands:
  mailing init                 initialize mailing in your app          [default]
  mailing preview              start the email preview server
  mailing export-previews      export previews as html
  mailing server [subcommand]  build and start the mailing server

Options:
  --version        Show version number                                 [boolean]
  --help           Show help                                           [boolean]
  --typescript     use Typescript          [boolean] [required] [default: false]
  --emails-dir     the directory to put your email templates in
                                                [required] [default: "./emails"]
  --port           what port to start the preview server on
                                                      [required] [default: 3883]
  --quiet          quiet mode (don't prompt or open browser after starting)
                                           [boolean] [required] [default: false]
  --scaffold-only  don't start the preview server
                                           [boolean] [required] [default: false]

ReferenceError: AbortSignal is not defined
    at PostHogClient.<anonymous> (/Users/petersugihara/mailing-next-level33/node_modules/posthog-node/lib/index.cjs.js:1234:17)
    at step (/Users/petersugihara/mailing-next-level33/node_modules/posthog-node/lib/index.cjs.js:140:27)
    at Object.next (/Users/petersugihara/mailing-next-level33/node_modules/posthog-node/lib/index.cjs.js:89:53)
    at /Users/petersugihara/mailing-next-level33/node_modules/posthog-node/lib/index.cjs.js:82:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/petersugihara/mailing-next-level33/node_modules/posthog-node/lib/index.cjs.js:68:12)
    at PostHogClient.PostHogCore.fetchWithRetry (/Users/petersugihara/mailing-next-level33/node_modules/posthog-node/lib/index.cjs.js:1231:16)
    at PostHogClient.PostHogCore.flush (/Users/petersugihara/mailing-next-level33/node_modules/posthog-node/lib/index.cjs.js:1218:14)
    at /Users/petersugihara/mailing-next-level33/node_modules/posthog-node/lib/index.cjs.js:1166:19
    at new Promise (<anonymous>)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

same issue on the first install

./src/moduleManifest.js
Module not found: Can't resolve './lib/beautify'

this is the code where its mentioned

if (typeof define === "function" && define.amd) {
      define([
        "./lib/beautify",
        "./lib/beautify-css",
        "./lib/beautify-html"
      ], function(js_beautify, css_beautify, html_beautify) {
        return get_beautify(js_beautify, css_beautify, html_beautify);
      });
    }

but I can't find any folder named lib.

image

@KishanFX I think that's a different issue related to Windows support (we don't support Windows yet). See #172 and related tickets.