FusionAuth / nodebb-plugin-fusionauth-oidc

NodeBB Plugin that allows users to login/register via any configured OAuth provider.
https://fusionauth.io
BSD 2-Clause "Simplified" License
9 stars 10 forks source link

Plugin assets aren't building #15

Closed ankeshanand1 closed 1 year ago

ankeshanand1 commented 2 years ago

NodeBB Version: v2.2.1 fusionauth-oidc Version: Latest

Here's how I built it: ./nodebb build ./nodebb start

The plugin is enabled and visible in menu but I cannot save any values. I checked /nodebb/build/public/plugins/ and fusionauth-oidc directory is missing. Here's the browser error on admin: error loading admin/plugins/fusionauth-oidc Error: Cannot find module './plugins/fusionauth-oidc' at https://domain/assets/admin.min.js?v=jmpct9e5d4s:2:23684 at async https://domain/assets/admin.min.js?v=jmpct9e5d4s:2:36568 at async Promise.all (index 0) at async app.require (https://domain/assets/admin.min.js?v=jmpct9e5d4s:2:36384) at async https://domain/assets/admin.min.js?v=jmpct9e5d4s:2:30411

Here are the build logs: `root@community:~/nodebb# ./nodebb build ./nodebb build 2022-06-27T13:17:49.431Z [4567/33781] - verbose: [minifier] utilizing a maximum of 0 additional threads 2022-06-27T13:17:50.441Z [4567/33781] - verbose: [build] Querying CPU core count for build strategy 2022-06-27T13:17:50.441Z [4567/33781] - verbose: [build] System returned 1 cores, opting for series build strategy 2022-06-27T13:17:50.442Z [4567/33781] - verbose: [build] building the following targets: plugin static dirs, requirejs modules, client js bundle, admin js bundle, client side styles, admin control panel styles, templates, languages started 2022-06-27T13:17:50.652Z [4567/33781] - verbose: [plugins] loading the following fields from plugin data: staticDirs, modules, clientScripts, acpScripts, cssFiles, lessFiles, acpLessFiles, languageData 2022-06-27T13:17:50.663Z [4567/33781] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-composer-default 2022-06-27T13:17:50.665Z [4567/33781] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-markdown 2022-06-27T13:17:50.665Z [4567/33781] - verbose: [plugins] Found 1 css file(s) for plugin nodebb-widget-essentials 2022-06-27T13:17:50.667Z [4567/33781] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-spam-be-gone 2022-06-27T13:17:50.669Z [4567/33781] - verbose: [plugins] Found 12 AMD-style module(s) for plugin nodebb-plugin-composer-default 2022-06-27T13:17:50.669Z [4567/33781] - verbose: [plugins] Found 3 AMD-style module(s) for plugin nodebb-theme-persona 2022-06-27T13:17:50.670Z [4567/33781] - verbose: [plugins] Found 1 AMD-style module(s) for plugin nodebb-plugin-markdown 2022-06-27T13:17:50.671Z [4567/33781] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-markdown 2022-06-27T13:17:50.671Z [4567/33781] - verbose: [plugins] Found 1 AMD-style module(s) for plugin nodebb-plugin-mentions 2022-06-27T13:17:50.671Z [4567/33781] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-mentions 2022-06-27T13:17:50.673Z [4567/33781] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-rewards-essentials 2022-06-27T13:17:50.673Z [4567/33781] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-fusionauth-oidc 2022-06-27T13:17:50.673Z [4567/33781] - verbose: [plugins] Found 1 AMD-style module(s) for plugin nodebb-plugin-dbsearch 2022-06-27T13:17:50.674Z [4567/33781] - verbose: [plugins] Found 2 AMD-style module(s) for plugin nodebb-plugin-spam-be-gone 2022-06-27T13:17:50.674Z [4567/33781] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-spam-be-gone 2022-06-27T13:17:50.674Z [4567/33781] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-spam-be-gone 2022-06-27T13:17:50.675Z [4567/33781] - verbose: [plugins] Found 2 js file(s) for plugin nodebb-theme-persona 2022-06-27T13:17:50.677Z [4567/33781] - verbose: [plugins] found 1 static directories for nodebb-rewards-essentials 2022-06-27T13:17:50.679Z [4567/33781] - verbose: [plugins] Found 2 js file(s) for plugin nodebb-plugin-composer-default 2022-06-27T13:17:50.681Z [4567/33781] - verbose: [plugins] found 1 static directories for nodebb-plugin-markdown 2022-06-27T13:17:50.684Z [4567/33781] - info: [build] Building in series mode 2022-06-27T13:17:50.685Z [4567/33781] - info: [build] plugin static dirs build started 2022-06-27T13:17:50.692Z [4567/33781] - info: [build] plugin static dirs build completed in 0.007sec 2022-06-27T13:17:50.692Z [4567/33781] - info: [build] requirejs modules build started 2022-06-27T13:17:50.820Z [4567/33781] - info: [build] requirejs modules build completed in 0.128sec 2022-06-27T13:17:50.820Z [4567/33781] - info: [build] client js bundle build started 2022-06-27T13:17:50.824Z [4567/33781] - info: [build] client js bundle build completed in 0.004sec 2022-06-27T13:17:50.824Z [4567/33781] - info: [build] admin js bundle build started 2022-06-27T13:17:50.826Z [4567/33781] - info: [build] admin js bundle build completed in 0.002sec 2022-06-27T13:17:50.826Z [4567/33781] - info: [build] client side styles build started 2022-06-27T13:17:58.036Z [4567/33781] - info: [build] client side styles build completed in 7.209sec 2022-06-27T13:17:58.036Z [4567/33781] - info: [build] admin control panel styles build started 2022-06-27T13:18:02.693Z [4567/33781] - info: [build] admin control panel styles build completed in 4.657sec 2022-06-27T13:18:02.693Z [4567/33781] - info: [build] templates build started 2022-06-27T13:18:02.941Z [4567/33781] - warn: [meta/templates] Partial not loaded: partials/topic/reactions.tpl 2022-06-27T13:18:03.725Z [4567/33781] - warn: [meta/templates] Partial not loaded: partials/topic/reactions.tpl 2022-06-27T13:18:03.743Z [4567/33781] - verbose: [meta/templates] Successfully compiled templates. 2022-06-27T13:18:03.743Z [4567/33781] - info: [build] templates build completed in 1.05sec 2022-06-27T13:18:03.744Z [4567/33781] - info: [build] languages build started 2022-06-27T13:18:06.799Z [4567/33781] - info: [build] languages build completed in 3.055sec 2022-06-27T13:18:06.800Z [4567/33781] - info: [build] Bundling with Webpack. 306 assets 852 modules

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance. Assets: c9273cd20328bd9c6d11b4990a39b30f.js (491 KiB) nodebb.min.js (1.12 MiB) admin.min.js (1.17 MiB) 8522.91481dcf9d211080cfcc.min.js (472 KiB) 4793.874eeda7b33b3d945f82.min.js (455 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. Entrypoints: nodebb (1.12 MiB) nodebb.min.js admin (1.17 MiB) admin.min.js

webpack 5.73.0 compiled with 2 warnings in 103130 ms 2022-06-27T13:19:50.959Z [4567/33781] - info: [build] Asset compilation successful. Completed in 120.273sec.`

It's a fresh install. Do you see any problems in it?

mooreds commented 2 years ago

I have not tested this on 2.2.1 since we are still on 1.18. I looked at the changes: https://nodebb.org/blog/migration-guide-for-v2/ and it might take a bit of time to get these implented.

Ishankhan21 commented 2 years ago

Hey @mooreds , @robotdan , @voidmain , @ankeshanand1 Facing similar issue, The save button is not working, Getting below error in the browser console, image Hey @ankeshanand1 do you have any solution which could help me?

ankeshanand1 commented 2 years ago

Hi @Ishankhan21 This error is because of CORS(Cross-Origin Resource Sharing). I tried addressing the issue in HTTP headers which did not solve my issue. The workaround here is to disable Google Chrome Security and then configure the plugin. Here it is: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security This will open a new Chrome windows ignoring the CORS and then you can configure the plugin successfully.

Because NodeBB is not inbuilt for SSL connections, HTTP headers inside it aren't getting forwarded in the NGINX or Apache Proxy Pass. That's the solution for my problem.

For your problem in the screenshot, it's actually downgrading your NodeBB from version 2.2.5 to version 1.19.8. I have tried all versions of NodeBB and this plugin is working correctly only in version 1.19.x . I also initially installed version 2.x which was not suitable for the plugin and as @mooreds suggested that he is using 1.18, I too downgraded to 1.18 and then upgraded one version at a time to see till which version it's working fine.

It's Version 1.19.x

Ishankhan21 commented 2 years ago

Thanks @ankeshanand1 , Downgrading to version 1.19.x worked for me, Also i figured out for CORS issues i have set the CORS headers on FusionAuth application level as below , then starting chrome with extra falgs is not neended.
image

ankeshanand1 commented 2 years ago

Thanks @ankeshanand1 , Downgrading to version 1.19.x worked for me, Also i figured out for CORS issues i have set the CORS headers on FusionAuth application level as below , then starting chrome with extra falgs is not neended. image

Thanks, that solved my issue as well!😀

Ishankhan21 commented 2 years ago

Hey @ankeshanand1 , I dont think this issues should be closed as extension is not working properly for latest versions above 1.19.x.

ankeshanand1 commented 2 years ago

Well, it depends on the contributors to make an updated version. I am also exploring the code to see version compatibility issues. But if you insist, here it is, reopened!

mooreds commented 2 years ago

Hiya folks, I will review PRs to make this plugin work with nodebb 2.x.

Ishankhan21 commented 2 years ago

Hey @mooreds , Please review this PR: https://github.com/FusionAuth/nodebb-plugin-fusionauth-oidc/pull/17, I have tested it locally please verify once.