question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ModuleNotFoundError, Windows Support

See original GitHub issue
 "dependencies": {
    "mailing": "^0.7.7",
    "mailing-core": "^0.7.7",
    "next": "^12.3.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  }

Node: v16.16.0, 14.20.0, 18.9.0 Shell: PowerShell v5.1.19041.1682

While running the development server i get this error image

also while running npx mailing i get this error upon start: image

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
alexfarrillcommented, Oct 26, 2022

Unfortunately, I have not found a solution to this, but I can give you some notes on what I had tried debugging:

  • I was speculating it may have to do with mixing / and \ in those paths on Windows in the modulManifest.js file, which is generated by setup.ts. However, in setup.ts we’re using import { resolve, posix, relative } from "path"; which should choose the proper file delimeter for each platform. I don’t think it is related to this after all.
  • looking at the specific error you posted, that seems to be referenced in js-beautify, which is a dependency of mjml-cli:
 grep -R "./lib/beautify"  node_modules
node_modules/js-beautify/js/index.js:    "./lib/beautify",
node_modules/js-beautify/js/index.js:    "./lib/beautify-css",
node_modules/js-beautify/js/index.js:    "./lib/beautify-html"

It may have to do with the way that the .mailing folder includes its node_modules – there is no directory .mailing/node_modules, instead we rely on module resolution traversing up to the root directory node_modules and finding those libraries correctly. I might give a look in your project root node_modules directory to see if you have a js-beautify directory and it has all the right stuff in it:

ls node_modules/js-beautify/js/lib/*
node_modules/js-beautify/js/lib/beautifier.js		node_modules/js-beautify/js/lib/beautify-html.js
node_modules/js-beautify/js/lib/beautifier.min.js	node_modules/js-beautify/js/lib/beautify.js
node_modules/js-beautify/js/lib/beautify-css.js		node_modules/js-beautify/js/lib/cli.js

node_modules/js-beautify/js/lib/unpackers:
javascriptobfuscator_unpacker.js	p_a_c_k_e_r_unpacker.js
myobfuscate_unpacker.js			urlencode_unpacker.js

Sorry I don’t know a concrete next step here, but hopefully that helps your debugging?

0reactions
Venipacommented, Dec 12, 2022

current semi fix is to use wsl for development

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 3 .9 ModuleNotFoundError Fix (Windows10) - YouTube
Open CMD or Command Prompt. 2. Paste the path C:\Users\youruser\AppData\Local\Programs\Python\Python36-32\Scripts\pip 3. Add install nameofthe ...
Read more >
IIS - ModuleNotFoundError - Python installed modules not ...
IIS - ModuleNotFoundError - Python installed modules not recognized by IIS. **My Python script is running fine from command prompt.
Read more >
ModuleNotFoundError: no module named Python Error ...
How to fix the ModuleNotFoundError in Python · 1. Make sure imported modules are installed · 2. Make sure modules are spelled correctly...
Read more >
Fatal Python error on Windows 10 ModuleNotFoundError
Go to the system environment settings and clear all old Python path or environment settings. Make sure you check the PATH in both...
Read more >
How to Fix ModuleNotFoundError and ImportError
first make sure you are using absolute imports · export the project's root directory to PYTHONPATH.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found