sawa-ko / revoltx

Revoltx is a Framework for revolt.js to create awesome bots.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module not found

net-tech opened this issue · comments

Hi there,

I'm having a bit of a strange issue. When I try to start my bot, I get the following error message

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/net-tech-/Developer/kydzs-splatoon-revolt-temp/node_modules/@kaname-png/revoltx/dist/lib/preconditions/conditions' imported from /Users/net-tech-/Developer/kydzs-splatoon-revolt-temp/node_modules/@kaname-png/revoltx/dist/index.js

I have checked manually, and the file does exist in node modules. I've tried reinstalling, deleting all node modules, using different package managers, and etc. While I know this may not be entirely the library's fault, I wanted to ask if you had any idea of what might be causing the issue.

Node Version 20.4.0
Typescript version 5.1.6
Revoltx version 2.0.5

commented

image

Strange, the file does exist in the production build in npmjs. Are you using commonjs or esm?

@sawa-ko Yeah, so I am using ESM. I can see the files in node modules. When I go to the file that imports everything in revoltx, dist/index.js, the errors seem to get more specific:

Could not find a declaration file for module '. /lib/preconditions/conditions'. '/Users/net-tech-/Developer/kydzs-splatoon-
revolt-temp/node_modules/@kaname-png/revolt×/dist/lib/preconditions/conditions.js' implicitly has an 'any' type. ts (7016)

and the same error appears for every export * from "somePath" in the revoltx index.js file.

Here's my TSConfig:

{
	"compilerOptions": {
		"module": "ESNext",
		"moduleResolution": "Node",
		"target": "ESNext",
		"esModuleInterop": true,
		"forceConsistentCasingInFileNames": true,
		"strict": true,
		"skipLibCheck": true,
		"allowJs": false,
		"noUnusedLocals": true,
		"noUnusedParameters": true,
		"allowSyntheticDefaultImports": true,
		"noImplicitAny": true,
		"noImplicitThis": true,
		"noFallthroughCasesInSwitch": true,
		"noImplicitOverride": true,
		"pretty": true,
		"rootDir": "./src",
		"outDir": "./dist",
		"experimentalDecorators": true
	}
}

The issue resolved itself after a full reinstall.