admin管理员组文章数量:1188028
I use Vercel and want to deploy a project. I'm using Lottie Animations that I have as JSON Data in the project. But Vercel just throws this error:
[15:23:18.194] > next build
[15:23:18.194]
[15:23:18.886] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[15:23:18.887] This information is used to shape Next.js' roadmap and prioritize features.
[15:23:18.888] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[15:23:18.888]
[15:23:18.888]
[15:23:19.000] ▲ Next.js 15.1.3
[15:23:19.000]
[15:23:19.033] Creating an optimized production build ...
[15:23:21.750] (node:227) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
[15:23:21.750] (Use `node --trace-deprecation ...` to show where the warning was created)
[15:23:26.821] Failed to compile.
[15:23:26.822]
[15:23:26.822] ./components/common/Loading.tsx
[15:23:26.822] Module not found: Can't resolve '../../lotties/loader.json'
[15:23:26.822]
[15:23:26.823]
[15:23:26.823]
[15:23:26.823] Import trace for requested module:
[15:23:26.823] ./app/values/page.tsx
[15:23:26.823]
[15:23:26.828]
[15:23:26.828] > Build failed because of webpack errors
[15:23:26.854] Error: Command "npm run build" exited with 1
[15:23:27.247]
Loading.tsx
"use client";
import React from "react";
import * as loader from "../../lotties/loader.json";
import Lottie from "react-lottie";
function Loading() {
const defaultOptions = {
loop: true,
autoplay: true,
animationData: loader,
rendererSettings: {
preserveAspectRatio: "xMidYMid slice",
},
};
return (
<div className="flex flex-col items-center justify-center h-screen">
<Lottie
options={defaultOptions}
isClickToPauseDisabled
style={{ width: "150px", height: "100px", cursor: "default" }}
/>
<h6 className="text-2xl font-light text-center mt-4">Hang tight! We’re discovering your passion...</h6>
</div>
);
}
export default Loading;
Folder structure
Is my folder structure wrong or am I using the json data wrong here?
I just want to use the JSON Lottie Data. The next build command is working locally but fails in Vercel.
Thanks for any help!
本文标签: vercelGetting an error when deploying a Nextjs Project with Lottie AnimationsStack Overflow
版权声明:本文标题:vercel - Getting an error when deploying a Next.js Project with Lottie Animations - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738376054a2083396.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论