tiddly-gittly / Modern.TiddlyDev

Modern TiddlyWiki Developing Environment
https://tiddly-gittly.github.io/Modern.TiddlyDev/
MIT License
57 stars 3 forks source link

Error [ERR_REQUIRE_ESM] On Build #41

Closed GameDungeon closed 1 year ago

GameDungeon commented 1 year ago

I was working on my plugin, and I added a new lib and it stopped building. After a bit, I removed it and tried again. Still errors. Looking closer at the trace, it seems the error is coming from modern and not my files?

Maybe a package was updated and broke everything?

C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\utils\screen-manager.js:4
const wrapAnsi = require('wrap-ansi');
                 ^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\wrap-ansi\index.js from C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\utils\screen-manager.js not supported.
Instead change the require of index.js in C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\utils\screen-manager.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\utils\screen-manager.js:4:18)
    at Object.<anonymous> (C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\prompts\base.js:14:23)
    at Object.<anonymous> (C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\prompts\list.js:11:14)
    at promptModule.restoreDefaultPrompts (C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\inquirer.js:61:33)
    at inquirer.createPromptModule (C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\inquirer.js:72:16)
    at Object.<anonymous> (C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\inquirer\lib\inquirer.js:84:28)
    at Object.<anonymous> (C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\tiddlywiki-plugin-dev\dist\js\init.js:11:40)
    at Object.<anonymous> (C:\Users\game\Desktop\Code\Tiddly\Tiddly2PDF\node_modules\tiddlywiki-plugin-dev\dist\js\main.js:5:13) {
  code: 'ERR_REQUIRE_ESM'
}
GameDungeon commented 1 year ago

I'm going to close this, as deleting my lock file seems to have fixed it. Weird.