-
Notifications
You must be signed in to change notification settings - Fork 760
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
[Bug] react-apollo can't resolve 'react-dom/server' in 7.0.x #1116
Comments
Does this happen with just react-apollo, or with every/any |
I'm not sure, my project only use react-apollo right now But I created a new project and added |
Go to the file Module.prototype.require = function (modulePath) {
// If we are running in the repo, we need to make sure
// module resolutions coming from other react-static packages
// are first attempted from the
var isInWorkspace = needsWorkspaceCheck && inRepo(this); // Only redirect resolutions to non-relative and non-absolute modules
if (!modulePath.startsWith('.') && !modulePath.startsWith('/')) {
if ( // If module is in the repo try and redirect
isInWorkspace || // Always try and redirect react and react-dom resolutions
['react', 'react-dom'].some(function (d) {
return modulePath.includes(d);
})) {
try {
modulePath = resolveFrom(path.resolve(process.cwd(), 'node_modules'), modulePath);
} catch (err) {//
}
}
}
return originalRequire.call(this, modulePath);
}; Then let me know if it works. |
Same
|
Is there a
|
There's a |
have you tried deleting your lock file and node_modules and reinstalling? |
react-apollo shouldn't have a problem resolving react-dom if it's right next to it in the node modules directory |
I have tried to delete and reinstall it many times |
I added a
|
It looks like the same issue in Next.js Delete |
One reason this could be happening is because of our development alias to hot-loader/react-dom. In master, I've removed this alias for a different implementation and am hoping that that change alleviates this issue. If you have means to do so, please build master and test. Otherwise, wait for the next release and we'll see if this is improved at all. |
You mean change the path to I have tried it before, nothing change. And I think the reason of this error is the Then
Browser will have a require error
|
Example project here. |
So...? |
I am also getting this issue, I can edit the alias but that doesn't fix the problem in my CI 😢 |
I add |
Getting this error as well. |
For what it's worth: I started getting this error after importing a google font in
Edit: After adding font weights to the import to meet heading stylings, the error disappeared.
|
The alias has been removed and appears to have fixed things. Reopen if needed. Thanks! |
Reporting a bug?
After updated from 6.3.6 to 7.0.7, react-apollo got problem.
Environment
The text was updated successfully, but these errors were encountered: