Comments (20)
@skgupta507 Can you give me access as collaborator ?
@Zeddxx i have added u as an collaborator accept the invitation.
Got it lemme try to fix it.
from moobie.
@skgupta507 I will help you if I have time, but try to search for answers yourself, as this will make you good at coding.
from moobie.
Thanks for the help.
from moobie.
@skgupta507 what error are you facing?
from moobie.
@skgupta507 what error are you facing?
@Zeddxx this is the Error Iam FAcing kindly guide me what to do
Creating an optimized production build ...
| ✓ Compiled successfully
| Linting and checking validity of types ...
| Collecting page data ...
| Generating static pages (0/8) ...
| Generating static pages (2/8)
Generating static pages (4/8)
| ⚠ metadataBase property in metadata export is not set for resolving social open graph or twitter images, using "https://moobie-ti2youlax-sunils-projects-4d721537.vercel.app". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
| ⚠ metadataBase property in metadata export is not set for resolving social open graph or twitter images, using "https://moobie-ti2youlax-sunils-projects-4d721537.vercel.app". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
| TypeError: Failed to parse URL from undefined/moobie/home
| at new Request (node:internal/deps/undici/undici:5855:19)
| at i (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:177204)
| ... 6 lines matching cause stack trace ...
| at a.startActiveSpan (/vercel/path0/.next/server/chunks/638.js:1:17333)
| at /vercel/path0/.next/server/chunks/638.js:1:47437 {
| [cause]: TypeError: Invalid URL
| at new URL (node:internal/url:796:36)
| at new Request (node:internal/deps/undici/undici:5853:25)
| at i (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:177204)
| at F (/vercel/path0/.next/server/chunks/638.js:1:39740)
| at /vercel/path0/.next/server/chunks/638.js:1:41889
| at /vercel/path0/.next/server/chunks/638.js:1:47585
| at a.with (/vercel/path0/.next/server/chunks/638.js:1:7544)
| at s.with (/vercel/path0/.next/server/chunks/638.js:1:1744)
| at s.startActiveSpan (/vercel/path0/.next/server/chunks/638.js:1:16799)
| at a.startActiveSpan (/vercel/path0/.next/server/chunks/638.js:1:17333) {
| code: 'ERR_INVALID_URL',
| input: 'undefined/moobie/home'
}
}
| ⚠ metadataBase property in metadata export is not set for resolving social open graph or twitter images, using "https://moobie-ti2youlax-sunils-projects-4d721537.vercel.app". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
| TypeError: Cannot read properties of undefined (reading 'map')
| at h (/vercel/path0/.next/server/app/(main)/home/page.js:6:17280)
| at em (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131205)
| at /vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142906
13:29:28.645 | at Array.toJSON (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:146484)
13:29:28.645 | at stringify ()
13:29:28.645 | at eR (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134868)
13:29:28.645 | at eP (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135311)
13:29:28.645 | at Timeout._onTimeout (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132091)
13:29:28.646 | at listOnTimeout (node:internal/timers:573:17)
13:29:28.646 | at process.processTimers (node:internal/timers:514:7)
13:29:28.646 | TypeError: Cannot read properties of undefined (reading 'map')
13:29:28.646 | at h (/vercel/path0/.next/server/app/(main)/home/page.js:6:17280)
13:29:28.646 | at em (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131205)
13:29:28.646 | at /vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142906
13:29:28.646 | at Array.toJSON (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:146484)
13:29:28.646 | at stringify ()
13:29:28.646 | at eR (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134868)
13:29:28.646 | at eP (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135311)
13:29:28.646 | at Timeout._onTimeout (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132091)
13:29:28.646 | at listOnTimeout (node:internal/timers:573:17)
13:29:28.646 | at process.processTimers (node:internal/timers:514:7)
13:29:28.646 | TypeError: Failed to parse URL from undefined/moobie/home
13:29:28.646 | at new Request (node:internal/deps/undici/undici:5855:19)
13:29:28.646 | at i (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:177204)
13:29:28.647 | ... 6 lines matching cause stack trace ...
13:29:28.647 | at a.startActiveSpan (/vercel/path0/.next/server/chunks/638.js:1:17333)
13:29:28.647 | at /vercel/path0/.next/server/chunks/638.js:1:47437 {
13:29:28.647 | [cause]: TypeError: Invalid URL
13:29:28.647 | at new URL (node:internal/url:796:36)
13:29:28.647 | at new Request (node:internal/deps/undici/undici:5853:25)
13:29:28.648 | at i (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:177204)
13:29:28.648 | at F (/vercel/path0/.next/server/chunks/638.js:1:39740)
13:29:28.648 | at /vercel/path0/.next/server/chunks/638.js:1:41889
13:29:28.648 | at /vercel/path0/.next/server/chunks/638.js:1:47585
13:29:28.648 | at a.with (/vercel/path0/.next/server/chunks/638.js:1:7544)
13:29:28.648 | at s.with (/vercel/path0/.next/server/chunks/638.js:1:1744)
13:29:28.648 | at s.startActiveSpan (/vercel/path0/.next/server/chunks/638.js:1:16799)
13:29:28.648 | at a.startActiveSpan (/vercel/path0/.next/server/chunks/638.js:1:17333) {
13:29:28.648 | code: 'ERR_INVALID_URL',
13:29:28.648 | input: 'undefined/moobie/home'
13:29:28.648 | }
13:29:28.648 | }
13:29:28.648 | TypeError: Cannot read properties of undefined (reading 'map')
13:29:28.648 | at h (/vercel/path0/.next/server/app/(main)/home/page.js:6:17280)
13:29:28.648 | at em (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131205)
13:29:28.648 | at /vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142906
13:29:28.648 | at Array.toJSON (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:146484)
13:29:28.648 | at stringify ()
13:29:28.648 | at eR (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134868)
13:29:28.648 | at eP (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135311)
13:29:28.648 | at Timeout._onTimeout (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132091)
13:29:28.649 | at listOnTimeout (node:internal/timers:573:17)
13:29:28.649 | at process.processTimers (node:internal/timers:514:7)
13:29:28.649 | TypeError: Cannot read properties of undefined (reading 'map')
13:29:28.649 | at h (/vercel/path0/.next/server/app/(main)/home/page.js:6:17280)
13:29:28.649 | at em (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131205)
13:29:28.649 | at /vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142906
13:29:28.649 | at Array.toJSON (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:146484)
13:29:28.649 | at stringify ()
13:29:28.649 | at eR (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134868)
13:29:28.649 | at eP (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135311)
13:29:28.649 | at Timeout._onTimeout (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132091)
13:29:28.649 | at listOnTimeout (node:internal/timers:573:17)
13:29:28.649 | at process.processTimers (node:internal/timers:514:7)
13:29:28.649 | Error occurred prerendering page "/home". Read more: https://nextjs.org/docs/messages/prerender-error
13:29:28.649 | TypeError: Cannot read properties of undefined (reading 'map')
13:29:28.649 | at h (/vercel/path0/.next/server/app/(main)/home/page.js:6:17280)
13:29:28.649 | at em (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131205)
13:29:28.650 | at /vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142906
13:29:28.650 | at Array.toJSON (/vercel/path0/node_modules/next/dist/compiled/next-server/app-
page.runtime.prod.js:12:146484)
13:29:28.650 | at stringify ()
13:29:28.650 | at eR (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134868)
13:29:28.650 | at eP (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135311)
13:29:28.650 | at Timeout._onTimeout (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132091)
13:29:28.650 | at listOnTimeout (node:internal/timers:573:17)
13:29:28.650 | at process.processTimers (node:internal/timers:514:7)
13:29:28.650 | Generating static pages (6/8)
13:29:28.650 | ✓ Generating static pages (8/8)
13:29:28.656 |
13:29:28.657 | > Export encountered errors on following paths:
13:29:28.657 | /(main)/home/page: /home
13:29:28.682 | Error: Command "npm run build" exited with 1
from moobie.
@skgupta507 The error you are encountering is because the environment variable MOOBIE_API_URL is missing, as it requires a backend connection.
from moobie.
@skgupta507 Also, before pushing to Vercel, try building the application on your local system to identify any specific errors.
from moobie.
@skgupta507 The error you are encountering is because the environment variable MOOBIE_API_URL is missing, as it requires a backend connection.
But there is no .env file
if u can provide the api link and the env template it would help me greatly
from moobie.
@skgupta507 Also, before pushing to Vercel, try building the application on your local system to identify any specific errors.
@Zeddxx i tried it first on my local machine i was getting the same error So i thought let me try vercel. i even tried netlify when i encountered the same error i opened the issue for ur help
from moobie.
i have added .env example as for the moobie api its a simple scrapper.
from moobie.
@skgupta507 I have hidden the error as it was looking annoying to me. 😅
from moobie.
i have added .env example as for the moobie api its a simple scrapper.
@Zeddxx thanks for going so far as to create an .env file with instructions i was able to depploy the site sucessfully.
now the issue comes to the api i have used a dramacool api but it dosent seems to work can u check one about it. Iam adding my .env file check it once
As this is just a simple consumetAPI of dramacool.
MOOBIE_API_URI=https://v1.api.ani.rohi.dev/api/dramacool
Your moobie base url.
NEXT_PUBLIC_APP_URL='https://moobiex.vercel.app'
from moobie.
@skgupta507 what I did was I am scrapping dramacool.com.pa and from title I am getting their I’d from consumetAPI.
just deploy your own instance of consumetApi and let me know.
from moobie.
@skgupta507 what I did was I am scrapping dramacool.com.pa and from title I am getting their I’d from consumetAPI.
just deploy your own instance of consumetApi and let me know.
@Zeddxx i already have a consumet api hosted here is the link https://api-consumet-org-olive.vercel.app/
from moobie.
@skgupta507 Now use nextjs api router to work as a backend and false at src/app/api/home/route.ts
.
Inside that file paste this:
`
async function scrapeCarousel() {
try {
const response = await axios.get(link of dramacool);
const $ = load(response.data);
const carouselSlider: CarouselSliderTypes[] = [];
const carouselElement = $("div.ls-slide");
carouselElement.each((index, element) => {
const img = $(element).find("img");
const imageSrc = img.attr("src") || "";
const title = img.attr("title") || "";
const dramaId = title.toLowerCase().split(" ").join("-");
carouselSlider.push({ dramaId, title, imageSrc, id: "", poster: "" });
});
if (carouselSlider.length > 0) {
const promises = carouselSlider.map(async (element) => {
const data = await scrapeSearchResults(element.title, 1);
const dramaId = data.results[0].id;
const id = dramaId.replace("drama-detail/", "");
const poster = data.results[0].image;
return { ...element, id, poster };
});
const updatedCarouselSlider = await Promise.all(promises);
carouselSlider.splice(0, carouselSlider.length, ...updatedCarouselSlider);
}
// Scrape recent dramas
const dramas: DramaInfo[] = [];
const recentDramaContainer = $("div.left-tab-1 ul.list-episode-item li");
recentDramaContainer.each((index, element) => {
const title = $(element).find(".title").text();
const href = $(element).find("a").attr("href") || "";
const idMatch = href.match(/\/([^/]+-\d+)-episode-\d+/);
const id = idMatch ? idMatch[1] : ""; // Extract the desired ID
const type = $(element).find(".type").text();
const time = $(element).find(".time").text().trim();
const episode = $(element).find(".ep").text();
const poster = $(element).find("a.img img").attr("data-original") || "";
dramas.push({ title, id, type, time, episode, poster });
});
// merging with id
if (dramas.length > 0) {
const promises = dramas.map(async (drama) => {
const data = await scrapeSearchResults(drama.title, 1);
const dramaId = data.results[0].id;
const id = dramaId.replace("drama-detail/", "");
return { ...drama, id };
});
const updatedDramasWithId = await Promise.all(promises);
dramas.splice(0, dramas.length, ...updatedDramasWithId);
}
// Scrape recent movies
const recentMovies: RecentMovies[] = [];
const recentMoviesContainer = $("div.left-tab-2 > ul.list-episode-item");
recentMoviesContainer.find("li").each(function () {
const title = $(this).find(".title").text().trim();
const id = title
.toLowerCase()
.split(" ")
.join("-")
.replace("(", "")
.replace(")", "");
const time = $(this).find(".time").text().trim();
const type = $(this).find(".type").text().trim();
const poster = $(this).find("img").attr("data-original") || "";
const episode = $(this).find(".ep").text().trim();
recentMovies.push({
id: id,
title: title,
time: time,
type: type,
poster: poster,
episode: episode,
});
});
if (recentMovies.length > 0) {
const promises = recentMovies.map(async (movie) => {
const data: SearchQueryResultTypes = await scrapeSearchResults(movie.title, 1);
const dramaId = data?.results[0].id;
const id = dramaId.replace("drama-detail/", "");
return { ...movie, id };
});
const updatedMoviesWithId = await Promise.all(promises);
recentMovies.splice(0, recentMovies.length, ...updatedMoviesWithId);
}
return { carouselSlider, recentDrama: dramas, recentMovies };
} catch (error) {
console.error("Error scraping homepage:", error);
throw error;
}
}
export default scrapeCarousel; `
And use this as search function:
async function scrapeSearchResults(query: string, page: number): Promise<SearchQueryResultTypes> { try { const { data } = await axios.get<SearchQueryResultTypes>(BASE_API_URI +
/movies/dramacool/${query}?page=${page}`)
const newData = data.results.map((result) => ({
...result,
id: result.id.replace("drama-detail/", "")
}))
return { ...data, results: newData };
} catch (error) {
throw createHttpError.BadRequest("Something went wrong! please try again later.")
}
}
export default scrapeSearchResults; `
from moobie.
@Zeddxx sorry for disturbing u so much but i got this error during deployment.
Failed to compile.
./src/api/home/route.ts
1:78 Error: Parsing error: ',' expected.
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
Error: Command "npm run build" exited with 1
from moobie.
@skgupta507 Can you give me access as collaborator ?
from moobie.
@skgupta507 Can you give me access as collaborator ?
@Zeddxx i have added u as an collaborator accept the invitation.
from moobie.
@skgupta507 i have only fixed the moobie home not other routes.
from moobie.
@skgupta507 i have only fixed the moobie home not other routes.
@Zeddxx Let me what code I need to update or change i will try to do it
If I am unable to do i may have to ask ur help again ☺
And thanks for giving me ur precious time it's much appreciated
from moobie.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moobie.