Giter Site home page Giter Site logo

Comments (5)

SunGiantor avatar SunGiantor commented on August 22, 2024

If you encounter error: can't resolve'..// build/Release/agora_ node_ Ext' abnormal,

You need to add in webpack packaging configuration:

externals: { 'agora-electron-sdk': 'commonjs2 agora-electron-sdk' }

for example.
webpack.base.js =》

module.exports = {
externals: { 'agora-electron-sdk': 'commonjs2 agora-electron-sdk' },
resolve: {
fallback: {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer/'),
}

2、while in Linux :Error:unsupported platform!
update agora-classroom-sdk/package.json :
"agora_electron": {"electron_version": "12.0.0","prebuilt": true}
to
"agora_electron": {"electron_version": "12.0.0","prebuilt": true,"platform":"win32" | "darwin",}

from cloudclass-desktop.

dlwnsgml0328 avatar dlwnsgml0328 commented on August 22, 2024

@SunGiantor
Thanks for replying my question!

If I create my project using CRA(create-react-app), should I have to eject my package to modify webpack?

eject means (react-script)

$ yarn eject 

from cloudclass-desktop.

SunGiantor avatar SunGiantor commented on August 22, 2024

@dlwnsgml0328 YES

from cloudclass-desktop.

SunGiantor avatar SunGiantor commented on August 22, 2024

Users who use CRA to create projects will report errors when importing agora-classroom-sdk library:
Could not resolve "../build/Release/agora-rc-extension"
Can't resolve '../../build/Release/agora_node_ext'
Can't resolve '../build/Release/agora-rc-extension'

you need to configure the externals property of the webpack config as below:
{
'agora-electron-sdk': 'commonjs2 agora-electron-sdk',
'agora-rdc-core': 'commonjs2 agora-rdc-core',
}
because there's no way to edit webpack configure file directly, so the 'react-app-rewired' project is a option to override the webpack configure.
you can follow the steps as below:
add react-app-rewired as a dev dependency to your your project
npm install react-app-rewired --save-dev
create a new file 'config-overrides.js' at your project's root directory,
module.exports = function override(config, env) {
//do stuff with the webpack config...
console.log('config', config);
if(!config.externals){
config.externals = {};
}
config.externals['agora-electron-sdk'] = 'commonjs2 agora-electron-sdk';
config.externals['agora-rdc-core'] = 'commonjs2 agora-rdc-core';
return config;
};

change the CRA commands:

"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
}
restart your project

from cloudclass-desktop.

durdenx avatar durdenx commented on August 22, 2024

If i add externals like you said to my config

config.externals['agora-electron-sdk'] = 'commonjs2 agora-electron-sdk';
config.externals['agora-rdc-core'] = 'commonjs2 agora-rdc-core';

It doesn't work on Nextjs and vercel...

I'm using this instead:

<Script
  id="agora-edu-sdk"
  strategy="afterInteractive"
  src="https://download.agora.io/edu-apaas/release/[email protected]"
/>

from cloudclass-desktop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.