iseizuu / anime-wallpaper

Get Anime wallpapers based on scraping from websites.
https://anime-wall.aizuu.my.id/
MIT License
17 stars 2 forks source link

Error AnimeSource #13

Closed NoheliGT closed 3 months ago

NoheliGT commented 3 months ago

Can you help me with this error when trying to do searches?

const wallpaper = await wall.search({ title: `${a}` }, AnimeSource.WallHaven);
                                                                   ^

Console: TypeError: Cannot read properties of undefined (reading 'WallHaven')

iseizuu commented 3 months ago

hello, what version of anime-wallpaper do u use? do you already import the type in the variable? example: const { AnimeWallpaper, AnimeSource } = require('anime-wallpaper');

NoheliGT commented 3 months ago

The version I'm using is: anime-wallpaper": "^1.1.1"; and yes, if I imported the variable in const { Anime Wallpaper, Anime Source } = require('anime-wallpaper'); So that's not the problem, I've been using this library for a while now but I only used it to generate random wallpapers and that works. I only have a problem with specific searches

iseizuu commented 3 months ago

version 1.1.1 is now deprecated, you can update to the latest version 3.1.0

NoheliGT commented 3 months ago

The update didn't work for me, I don't understand what the problem could be, but oh well, thanks.

node:internal/modules/cjs/loader:372 throw err; ^

Error: Cannot find module 'C:\Users\Usuario PC\Documents\BOTOFICIAL\node_modules\anime-wallpaper\dist*\'. Please verify that the package.json has a valid "main" entry at tryPackage (node:internal/modules/cjs/loader:364:19) at Function.Module._findPath (node:internal/modules/cjs/loader:577:18) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27) at Function.Module._load (node:internal/modules/cjs/loader:804:27) at Module.require (node:internal/modules/cjs/loader:1028:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:\Users\Usuario PC\Documents\BOTOFICIAL\index.js:17:42) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', path: 'C:\Users\Usuario PC\Documents\BOTOFICIAL\node_modules\anime-wallpaper\package.json', requestPath: 'anime-wallpaper'

iseizuu commented 3 months ago

uh, are you sure this is the latest version?

NoheliGT commented 3 months ago

yes

iseizuu commented 3 months ago

image just tried: Runkit and its work well.

try reinstall and install again, hope fix the issue

NoheliGT commented 3 months ago

Thanks, I already solved it with the version 2.0.0

iseizuu commented 3 months ago

Thanks, I already solved it with the version 2.0.0

try v3.2.1, for the latest release