Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Fix for webpack warning: Critical dependency: the request of a depend… #3626

Closed
wants to merge 1 commit into from

Conversation

DB-Alex
Copy link

@DB-Alex DB-Alex commented Sep 15, 2022

…ency is an expression

Use a static dependency import for react-dom using the same code as next.js:

https://github.com/vercel/next.js/blob/6108f10799b46bc0ef97373c913e23714e135942/packages/next/server/render.tsx#L92

Summary

Result

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9e62152:

Sandbox Source
react-instantsearch-app Configuration
hooks-example Configuration

@netlify
Copy link

netlify bot commented Sep 15, 2022

Deploy Preview for react-instantsearch ready!

Name Link
🔨 Latest commit 9e62152
🔍 Latest deploy log https://app.netlify.com/sites/react-instantsearch/deploys/63234d89ce2ac70008bbccf2
😎 Deploy Preview https://deploy-preview-3626--react-instantsearch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@Haroenv
Copy link
Contributor

Haroenv commented Sep 19, 2022

sorry, but this causes webpack/webpack#13865 to reappear. This does indeed give the "critical dependency", but it's actually on purpose as webpack has a bug and doesn't process conditional imports correctly

@Haroenv
Copy link
Contributor

Haroenv commented Nov 28, 2022

When renderToString is passed as an argument, this code path can be bypassed, and the error no longer happens. Thanks for your contribution!

@Haroenv Haroenv closed this Nov 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants