facebookresearch / segment-anything

The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
Apache License 2.0
47.81k stars 5.65k forks source link

Fix critical dependency warning in webpack config #783

Open HendricksJudy opened 1 month ago

HendricksJudy commented 1 month ago

Fixes #777

Replace require statements with import statements in Webpack configuration files to resolve the critical dependency warning and blank page issue.

snk8828912 commented 3 weeks ago

@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'
}