Comments (5)
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.
@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.
@dlwnsgml0328 YES
from cloudclass-desktop.
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.
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)
- How to restart a room? HOT 5
- How to list rooms HOT 2
- Global css isolation HOT 1
- error Command "bootstrap" not found. HOT 1
- NextJs App With Agora Flexible Classroom Issue on error - Module not found: Can't resolve '../../build/Release/agora_node_ext' HOT 3
- demo 太难跑了 HOT 2
- Agora Flexible classroom - Chat not working HOT 3
- 进入房间失败,响应400:{"message":"appid is invalid"} HOT 2
- 打包web
- The link to plugin gallery in website is wrong HOT 1
- demo跑不起来 HOT 3
- 怎么加日语翻译 HOT 2
- 怎么解 HOT 1
- Cannot install on M1 mac from version 2.5.0 HOT 1
- 能不能设置聊天用户的头像 HOT 2
- Chat, whiteboard not working HOT 3
- agora-rc-extension error HOT 2
- 因为npm源导致 yarn pack:electron:win 执行失败 HOT 1
- demo创建房间登入请求的时候404,在哪改 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudclass-desktop.