Closed JuanM04 closed 3 years ago
Thanks for reporting this issue. I've created two reproduction test cases in #30, but both pass locally. Do you also face these issue locally or is it just in the CodeSandbox? On which operating system are you?
It happened in my PC after updating next and other dependencies. I'm using WSL (ubuntu), but it also failed when I deployed it to Vercel
I downgraded to next v10.0.4 and it works. So, it has something to do with v10.0.5
That's good to know! I'll look into the updates made in 10.0.5 then.
Getting the same issue, Tried downgrading to 10.0.4 but no luck. Still getting the same error.
./pages/[...username].tsx
TypeError: E:\libby\libby-web\pages\[...username].tsx: d(...) is not a function
Is there a fix coming out soon?
Here's my code snippet:
export async function getServerSideProps({ params }) {
const users = await prisma.user.findMany({
where: {
name: params.toString()
}
})
return {
props: { users }
}
}
We haven't yet found the root cause. I've asked for input on the Next.js contributors Slack, but haven't received answers yet. I'm in contact with Prisma now, seems like they know more (https://github.com/vercel/next.js/issues/21043#issuecomment-759608184)
We haven't yet found the root cause. I've asked for input on the Next.js contributors Slack, but haven't received answers yet. I'm in contact with Prisma now, seems like they know more (vercel/next.js#21043 (comment))
Thanks for the update. I think I'll place the development of my webapp on hold for now until there's a conclusion/fix.
Getting the same issue, Tried downgrading to 10.0.4 but no luck. Still getting the same error.
Maybe you downgraded wrong. I have to yarn remove next && yarn add next@10.0.4
(without the ^
) to downgrade correctly. I downgraded wrong immeasurable times.
Getting the same issue, Tried downgrading to 10.0.4 but no luck. Still getting the same error.
Maybe you downgraded wrong. I have to
yarn remove next && yarn add next@10.0.4
(without the^
) to downgrade correctly. I downgraded wrong immeasurable times.
Alright I rechecked the version and it was stuck on 10.0.5 but I removed then installed next@10.0.4 and it works again. Only issue now is that it isn't showing data on Prisma but that's a separate issue altogether.
Update: I fixed it by changing params.toString()
to params.username.toString()
This indeed is a regression in Next.js 10.0.5. Bisecting lead me to https://github.com/vercel/next.js/pull/20586. I'm now further investigating it.
Further digging led me to @babel/plugin-transform-react-jsx, which is updated in the aforementioned PR.
Alright, so as a workaround I was able to make it work like this:
- export default function MyPage() {
+ function MyPage() {
..
}
+ export default MyPage
Can you confirm this?
In general, this error shows very weird behaviour. For example, it doesn't occur when JSX isn't used at all:
export default function AStringReturningComponent() {
return "something something help me understand why this works"
}
Can you confirm this?
Yes, it works. That's very odd
This is probably the most intricate build chain issue I've ever worked on 😳 Let's hope that the Babel team has an idea ... https://github.com/babel/babel/issues/12631
With the masterful help of @nicolo-ribaudo and @JLHwung, we were able to find a workaround.
@JuanM04 @ChGGse could you try out 0.1.9-fix-19-danger
(npm install babel-plugin-superjson-next@danger
)? If that works for you, I'll publish a patch update with that. It works locally for me, so I'm positive on this ^^
Yes, it works!!!
Amazing! :D
Published as v0.1.10.
What a ride! I'm really glad we solved this 🥳
@allcontributors add JuanM04 for bug
@Skn0tt
I've put up a pull request to add @JuanM04! :tada:
@allcontributors add ChGGse for bug
@Skn0tt
I've put up a pull request to add @ChGGse! :tada:
With the masterful help of @nicolo-ribaudo and @JLHwung, we were able to find a workaround.
@JuanM04 @ChGGse could you try out
0.1.9-fix-19-danger
(npm install babel-plugin-superjson-next@danger
)? If that works for you, I'll publish a patch update with that. It works locally for me, so I'm positive on this ^^
I'll test it out in the morning when I wake up!
https://codesandbox.io/s/clever-oskar-ltpop?file=/pages/index.js