English 中文(简体)
Web Pack ERROR in node:codeo 模块建设失败:无操作的SchemeError: 阅读“无:加密”
原标题:Webpack ERROR in node:crypto Module build failed: UnhandledSchemeError: Reading from "node:crypto"

我试图更新一些旧法典,以消除警告。 我升级了一些使用加密模块的代码。 然而,第5.88.2号网络不承认新的辛迪加。 我的新进口就是这样:

const crypto = await import( node:crypto );

完全错误就是这样。 它表明,我可能需要另一个假想,但我无法找到。

ERROR in node:crypto
Module build failed: UnhandledSchemeError: Reading from "node:crypto" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
    at C:xxxxxfunctionsauth-check
ode_moduleswebpacklibNormalModule.js:838:25        
    at Hook.eval [as callAsync] (eval at create (C:xxxxxfunctionsauth-check
ode_modules	apablelibHookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:xxxxxfunctionsauth-check
ode_modules	apablelibHook.js:18:14)
    at Object.processResource (C:xxxxxfunctionsauth-check
ode_moduleswebpacklibNormalModule.js:835:8)
    at processResource (C:xxxxx
ode_modulesloader-runnerlibLoaderRunner.js:220:11)
    at iteratePitchingLoaders (C:xxxxxfunctionsauth-check
ode_modulesloader-runnerlibLoaderRunner.js:171:10)
    at runLoaders (C:xxxxx
ode_modulesloader-runnerlibLoaderRunner.js:398:2)
    at NormalModule._doBuild (C:xxxxxauth-check
ode_moduleswebpacklibNormalModule.js:825:3)
    at NormalModule.build (C:xxxxxfunctionsauth-check
ode_moduleswebpacklibNormalModule.js:969:15)
    at C:xxxxxfunctionsauth-check
ode_moduleswebpacklibCompilation.js:1377:12        
 @ ./src/index.ts 6:21-42

webpack 5.88.2 compiled with 1 error in 2790 ms
问题回答

页: 1

我在我的项目中遇到了上述错误,这是纠正错误的指令。

npm 安装流-浏览加密程序

如果你利用下一个项目在5号网络上工作,这就是获得更多支持的联系。

https://developer.tbd.website/docs/web5/build/framework/next/

第一包

www.un.org/spanish/ga istream-browserification codeo-browserification

之后,对您的下调做了如下改动。

/** @type {import( next ).NextConfig} */
const nextConfig = {
  reactStrictMode: true,

  webpack: (config, { isServer, buildId, dev, webpack }) => {
    if (!isServer) {
      config.resolve.fallback = {
        ...config.resolve.fallback,
        stream: require.resolve( stream-browserify ),
        crypto: require.resolve( crypto-browserify ),
      };

      config.plugins.push(
        new webpack.ProvidePlugin({
          process:  process/browser ,
        }),
        new webpack.NormalModuleReplacementPlugin(
          /node:crypto/,
          (resource) => {
            resource.request = resource.request.replace(/^node:/,   );
          }
        )
      );
    }
    return config;
  },
};

module.exports = nextConfig;




相关问题
How to make Sequelize use singular table names

I have an model called User but Sequelize looks for the table USERS whenever I am trying to save in the DB. Does anyone know how to set Sequelize to use singular table names? Thanks.

What is Node.js? [closed]

I don t fully get what Node.js is all about. Maybe it s because I am mainly a web based business application developer. What is it and what is the use of it? My understanding so far is that: The ...

Clientside going serverside with node.js

I`ve been looking for a serverside language for some time, and python got my attention somewhat. But as I already know and love javascript, I now want learn to code on the server with js and node.js. ...

Can I use jQuery with Node.js?

Is it possible to use jQuery selectors/DOM manipulation on the server-side using Node.js?

How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

热门标签