-
-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
got "undefined is not a function" when run "npm run build" nextjs 13 #1324
Labels
Comments
I found the issue is with the accept: accept: {
"image/*": [],
}, nor accept: {
"image/jpeg": [],
"image/png": [],
}, Doesn't seem to work on build - I've removed it and I'm going to handle it in validation instead |
Any idea how to fix it ? This is my example
|
Downgraded to version 11.7.1, changed accept and it worked. |
downgrading to 14.1.2 worked for me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
i'm using useDropzone and got error "undefined is not a function" when build in nextjs 13.5
here is the error log:
Error occurred prerendering page "/regchannel". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: undefined is not a function
at Array.every ()
at D:\fpt\git\lily.next\server\chunks\4622.js:1:14868
at Array.filter ()
at D:\fpt\git\lily.next\server\chunks\4622.js:1:14572
at Object.nr [as useMemo] (D:\fpt\git\lily\node_modules\next\dist\compiled\next-server\app-page-experimental.runtime.prod.js:27:35119)
at Module.t.useMemo (D:\fpt\git\lily\node_modules\next\dist\compiled\next-server\app-page-experimental.runtime.prod.js:51:8206)
at de (D:\fpt\git\lily.next\server\chunks\4622.js:1:14494)
at Page (D:\fpt\git\lily.next\server\app(def)\regchannel\page.js:1:4746)
at nP (D:\fpt\git\lily\node_modules\next\dist\compiled\next-server\app-page-experimental.runtime.prod.js:27:42286)
at nO (D:\fpt\git\lily\node_modules\next\dist\compiled\next-server\app-page-experimental.runtime.prod.js:27:58995)
here is the code: or use this link: https://github.com/kitsuneremi/lily/blob/main/app/testx/page.tsx
"use client";
import NextImage from "next/image";
import { useState, useCallback, useRef, useEffect } from "react";
import { useDropzone, Accept } from "react-dropzone";
import { PinturaEditorModal } from "@pqina/react-pintura";
import { uploadBytes, ref } from "firebase/storage";
import { storage } from "@/lib/firebase";
import Link from "next/link";
import { useToast } from "@/components/ui/use-toast";
import axios from "axios";
import { useSession } from "next-auth/react";
import { baseURL } from "@/lib/functional";
import "@pqina/pintura/pintura.css";
import {
// editor
locale_en_gb,
createDefaultImageReader,
createDefaultImageWriter,
createDefaultShapePreprocessor,
} from "@pqina/pintura";
import { redirect, useRouter } from "next/navigation";
setPlugins(plugin_crop, plugin_finetune, plugin_filter, plugin_annotate);
const editorDefaults = {
utils: [
"crop",
// "finetune",
// "filter",
// "annotate"
],
imageReader: createDefaultImageReader(),
imageWriter: createDefaultImageWriter(),
shapePreprocessor: createDefaultShapePreprocessor(),
...plugin_finetune_defaults,
...plugin_filter_defaults,
...markup_editor_defaults,
locale: {
...locale_en_gb,
...plugin_crop_locale_en_gb,
...plugin_finetune_locale_en_gb,
...plugin_filter_locale_en_gb,
...plugin_annotate_locale_en_gb,
...markup_editor_locale_en_gb,
},
};
export default function Page() {
const [originalAvatar, setOriginalAvatar] = useState<{
file: File;
width: number;
height: number;
} | null>(null);
}
The text was updated successfully, but these errors were encountered: