sofn-xyz / mailing

Build, test, send emails with React
https://www.mailing.run
MIT License
3.6k stars 74 forks source link

npx mailing preview throws Module not found error. #450

Closed senthil-sprint1 closed 1 year ago

senthil-sprint1 commented 1 year ago

When I run npx mailing preview, I get the following error. Module not found: Can't resolve './lib/beautify'

To Reproduce

Expected behavior When I navigate to localhost:3883, I should see previews of email templates but I get the "Failed to compile" error.

Screenshots image

Desktop (please complete the following information): Windows 11

>  Get-ComputerInfo | select WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer

WindowsProductName WindowsVersion OsHardwareAbstractionLayer
------------------ -------------- --------------------------
Windows 10 Home    2009           10.0.22000.1219

Additional context Here is the console output when I run npx mailing preview

# npx mailing preview
mailing starting preview server
mailing scanning for previews at ./emails/previews [ 'Welcome.tsx' ]
mailing linting templates in ./emails...
event - compiled client and server successfully in 752 ms (265 modules)
mailing watching for changes to emails
mailing running preview at http://localhost:3883/
error - uncaughtException: Error: spawn undefined\System32\WindowsPowerShell\v1.0\powershell ENOENT
    at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
    at __node_internal_errnoException (node:internal/errors:594:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn undefined\\System32\\WindowsPowerShell\\v1.0\\powershell',
  path: 'undefined\\System32\\WindowsPowerShell\\v1.0\\powershell',
  spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBoAHQAdABwADoALwAvAGwAbwBjAGEAbABoAG8AcwB0ADoAMwA4ADgAMwAvACIA'
  ]
}
wait  - compiling / (client and server)...
error - ./src/moduleManifest.js
Module not found: Can't resolve './lib/beautify'

https://nextjs.org/docs/messages/module-not-found
alexfarrill commented 1 year ago

Hi there @senthil-sprint1, unfortunately Mailing does not currently run on Windows. We have an issue open here to support it and I'll reference this issue there as well: https://github.com/sofn-xyz/mailing/issues/172

Unfortunately we haven't made much progress on debugging this. Do you have any ideas what the issue could be? Thoughts (or pull requests!) always welcome. Thanks -Alex