Fix critical dependency warning in webpack config#783
Open
HendricksJudy wants to merge 1 commit intofacebookresearch:mainfrom
Open
Fix critical dependency warning in webpack config#783HendricksJudy wants to merge 1 commit intofacebookresearch:mainfrom
HendricksJudy wants to merge 1 commit intofacebookresearch:mainfrom
Conversation
Fixes facebookresearch#777 Replace `require` statements with `import` statements in Webpack configuration files to resolve the critical dependency warning and blank page issue. * **`demo/configs/webpack/common.js`** - Replace `require` statements with `import` statements. - Update `module.exports` to `export default`. * **`demo/configs/webpack/dev.js`** - Replace `require` statements with `import` statements. - Update `module.exports` to `export default`. * **`demo/configs/webpack/prod.js`** - Replace `require` statements with `import` statements. - Update `module.exports` to `export default`.
|
@HendricksJudy yarn build ,and error like this [webpack-cli] Failed to load 'D:\ai\sam\segment-anything\demo\configs\webpack\prod.js' config
[webpack-cli] Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'D:\ai\sam\segment-anything\demo\configs\webpack\common' imported from D:\ai\sam\segment-anything\demo\configs\webpack\prod.js
at new NodeError (node:internal/errors:372:5)
at finalizeResolution (node:internal/modules/esm/resolve:437:11)
at moduleResolve (node:internal/modules/esm/resolve:1009:10)
at defaultResolve (node:internal/modules/esm/resolve:1218:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
at link (node:internal/modules/esm/module_job:78:36) {
code: 'ERR_MODULE_NOT_FOUND'
} |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #777
Replace
requirestatements withimportstatements in Webpack configuration files to resolve the critical dependency warning and blank page issue.demo/configs/webpack/common.jsrequirestatements withimportstatements.module.exportstoexport default.demo/configs/webpack/dev.jsrequirestatements withimportstatements.module.exportstoexport default.demo/configs/webpack/prod.jsrequirestatements withimportstatements.module.exportstoexport default.