-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
swcMinify: true - ReferenceError: Can't find variable: excludeEmptyString #30429
Comments
@JClackett it's |
Yeah I do! is this documented as to why this wouldn't work with swc minification? and if there's a fix? Example yup code: import * as Yup from "yup"
Yup.addMethod(Yup.string, "nullIfEmpty", function () {
return this.transform((val, origVal) => (origVal.trim() === "" ? null : val)).nullable()
})
Yup.addMethod(Yup.number, "nullIfEmpty", function () {
return this.transform((val, origVal) => (origVal === "" ? null : val)).nullable()
})
export default Yup |
We have come across a similar issue with yup email:
|
I'm seeing a similar issue when NextJS Version 12.0.2
|
same issue here with 12.0.1 and yup 0.32.9 swcMinify: true |
This is related to my issue posted here: #30498 |
I'm having the same issue with for me, a temporary downgrade to On the next.js v12 with enabled |
Having same issue with email validation with |
I think setting |
Having a similar issue using v12.0.3 and yup. Going to turn off |
Same issue with Nextjs v12.0.3 and yup 0.32.11.
|
I think this is fixed by #31242 |
Great! I'll test it once that commit gets released. |
@neilpoulin you can try it using |
Did you find what was causing your issue? I get the same when I enable swcMinify. |
Hey @rodilo! Yeah, I get that too. If it's yup your using, it seems the swc compiler is incompatible with I also think there is a canary version of Next 12 that addresses this issue. You can use install |
I've found what was causing mine, it's |
Yeah, I get the same error with the canary version as well. |
I got same error while using next^12.0.2 |
The issue with yup has been fixed on the latest stable as @BluetyIt mentioned. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.1
What version of Node.js are you using?
16.10.0
What browser are you using?
Safari
What operating system are you using?
MacOS
How are you deploying your application?
Vercel
Describe the Bug
I'm sure its connected to other issues, but thought I'd provide some more context.
Setting the swcMinify config to true seems to break something in the runtime as it successfully builds and deploys, but then when navigating to certain pages I get:
Expected Behavior
Not error :)
To Reproduce
Our team has a boilerplate repo we use on all our projects:
https://github.com/NoQuarterTeam/boilerplate
The text was updated successfully, but these errors were encountered: