Closed sdk1990 closed 10 months ago
Thank you @sdk1990 ; I will try to have a closer look soon. 2 quick comments though:
Thank you @sdk1990 ; I will try to have a closer look soon. 2 quick comments though:
- There is conflicts, I don't know why. Could you try to rebase your branch on master?
- If you import RouterContext like this, won't it break for earlier version of Next?
You are totally right @cvolant, I just had a better look and will pay more attention in the future :) Just fixed the conflicts and also implemented dynamic loading of the module with a fallback pointing to the original import path.
Please merge this :)
Thank you for the fixes. Did you succeed to run it with next 11.0.0 ? I tried but it did not work. I fought with it for a while : not an easy one. I tried another approach using Webpack fallback instead of dynamic loading, but did not succeed. I am only a Webpack padawan though, not sure I did it right...
if (!config.resolve) {
config.resolve = {}
}
if (!config.resolve.fallback) {
config.resolve.fallback = {
['next/dist/shared/lib/router-context.shared-runtime']: 'next/dist/next-server/lib/router-context',
}
} else if (Array.isArray(config.resolve.fallback)) {
config.resolve.fallback.push({
alias: 'next/dist/shared/lib/router-context.shared-runtime',
name: 'next/dist/next-server/lib/router-context',
})
} else {
config.resolve.fallback['next/dist/shared/lib/router-context.shared-runtime'] =
'next/dist/next-server/lib/router-context'
}
I did not try with next > 11.0.0. If it work with 11.1.0 for example, we could merely change next peer dependency from 11.0.0 to 11.1.0...
I did not try with next > 11.0.0. If it work with 11.1.0 for example, we could merely change next peer dependency from 11.0.0 to 11.1.0...
I can't get 11.0.0 and 11.10.0 to work unfortunately. Maybe release the fix in this PR as a major change? In that way, older projects can use v1.10.2 of this package.
Maybe release the fix in this PR as a major change?
:thinking: I am not found of it, but if it is the only option, I will have to. But then the dynamic import would not be needed anymore...
But I think it is probably possible to tackle this with some Webpack magic, either with the fallback config, or maybe we could use a conditionnal resolve config depending on Next version... I will try to take some time to try it again.
@sdk1990, I fought with it way longer than I should, be I finally get it working in this new PR. Could you take a look at it? Would it be ok for you?
any update of this?
hello, any update status of this ?
hello, any update status of this ?
Please merge this :)
Hey is there an update on this?
Yes, at last! I just release 1.11.0-5, that basically does what this PR did: dropping support for old next version (<13.5.0). I tried hard to maintain the support, as reflected in the version number, without success unfortunately. I hope everything is is ok now. If yes, I will release 1.11.0.
Fixes issue #80: