Skip to content
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

Widget upload bug: jQuery.Deferred exception: e is not a function #351

Closed
heymartinadams opened this issue Oct 18, 2022 · 10 comments
Closed
Labels

Comments

@heymartinadams
Copy link

Description

Upon uploading an image from the desktop, I get the following issue:
jQuery.Deferred exception: e is not a function

Steps to reproduce

  1. Sign up at simplerlist.com
  2. Fill out your name, then try to upload a profile photo.
  3. After upload, I get a blank screen:

CleanShot 2022-10-18 at 10 18 44@2x

4. The console says this:

CleanShot 2022-10-18 at 10 17 55@2x

Environment

  • widget version: "@uploadcare/react-widget": "^2.2.0",
  • node -v: v16.16.0
@heymartinadams
Copy link
Author

For what it’s worth, I’m using next-safe to limit API calls to third-party libraries. Not sure if that breaks Uploadcare.

@nd0ut
Copy link
Member

nd0ut commented Oct 18, 2022

Hey @heymartinadams,

next-safe is definitely not a problem.

Looks like there are some naming collisions on js minification stage.

Are you using the default next.js webpack config or the custom one?

@heymartinadams
Copy link
Author

@nd0ut I’m using the following NextJS config:

const nextConfig = {
	compiler: {
		removeConsole: process.env.ENV !== 'dev'
	},
	// env variables that don’t begin with `NEXT_PUBLIC_` need to be assigned here
	env,
	experimental: {
		newNextLinkBehavior: true,
		images: {
			allowFutureImage: true,
			unoptimized: process.env.ENV === 'prd_capacitor'
		}
	},
	headers,
	images: {
		domains: ['images.unsplash.com']
	},
	pwa: {
		dest: 'public',
		// TODO: process.env.ENV === 'dev' || process.env.ENV === 'prd_capacitor'
		disable: true,
		register: true,
		skipWaiting: true,
		runtimeCaching
	},
	reactStrictMode: false,
	redirects,
	swcMinify: true,
	webpack: config => config
}

@nd0ut
Copy link
Member

nd0ut commented Oct 18, 2022

Is it Next.js v12.3.0?

Anyway, please try to disable swcMinify so Next.js will use terser in that case. I'm pretty sure that SWC minifier causes this problem.

I will prepare an issue to next.js If it helps.

@heymartinadams
Copy link
Author

Thanks so much, @nd0ut! That was the issue indeed ☺️

@KrokoYR
Copy link

KrokoYR commented Oct 24, 2022

Hi @nd0ut can you please share a link to an issue to NextJS please, I've met the same problem, so I would like to subscribe to updates.

@heymartinadams
Copy link
Author

heymartinadams commented Nov 2, 2022

NextJS 13 now has swcMinify enabled by default. https://nextjs.org/docs/advanced-features/compiler

Any update on when we can use it, @nd0ut?

@nd0ut
Copy link
Member

nd0ut commented Nov 16, 2022

@KrokoYR @heymartinadams

Sorry guys, I haven't created an issue to next.js repo yet.
Writing a minimal reproducible example becomes harder than I thought.

@nd0ut
Copy link
Member

nd0ut commented Nov 17, 2022

Here it is - swc-project/swc#6463

@nd0ut
Copy link
Member

nd0ut commented Mar 23, 2023

This problem was fixed in next@13.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants