WARP-LAB / files_3dmodelviewer

3D Model Viewer for Nextcloud
GNU Affero General Public License v3.0
38 stars 6 forks source link

Viewer not opening #2

Closed anomaly256 closed 1 year ago

anomaly256 commented 1 year ago

Describe the bug

Preview doesn't open, Nextcloud just downloads the file when clicked

To Reproduce

Steps to reproduce the behavior:

  1. Install app
  2. Upload .obj or .stl files
  3. Browse to them in the Files app
  4. Click on them

Expected behavior

The 3d viewer preview screen to display

Desktop (please complete the following information)

Browser log

GET https://[redacted]/custom_apps/files_3dmodelviewer/js/files_3dmodelviewer.js?v=841b80fe-19 net::ERR_ABORTED 404
Refused to execute script from 'https://[redacted]/custom_apps/files_3dmodelviewer/js/files_3dmodelviewer.js?v=841b80fe-19' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
anomaly256 commented 1 year ago

Fyi the app store is now telling me: Error: This app cannot be enabled because it makes the server unstable

kroko commented 1 year ago
  1. How did you install the app - via app store or manually unpacking the tar.gz and putting it into place?
  2. Browser log mentions custom_apps in the path. Do you mind sharing your value for key apps_path as set in config/config.php file? Ref: Using custom app directories
  3. App assumes it is installed in apps as it is place it should be installed in standard NC installations.
  4. Your browser logs tells that NC is trying to load it from custom_apps -> the script is not there -> NC does rewrite to HTML as it does with non existing resources -> browser sees that instead of js it receives text/html and thing dies.
  5. Does files_3dmodelviewer directory actually exist in filesystem path for /custom_apps URL? Or filesystem path for /apps URL ? Taking example config below that would be /path/to/custom/apps/wherever/it/is or /path/to/nextcloud/root/apps respectively.
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/path/to/nextcloud/root/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/path/to/custom/apps/wherever/it/is',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
anomaly256 commented 1 year ago

1) via the app store on an existing, upgraded install

2-5) I'm reinstalling a clean instance as I found other issues with this one that had been upgraded and upgraded over many years. I'll let you know if the problem exists in that new environment or close this issue if not

kroko commented 1 year ago

Ok. I'd suggest to not use custom apps_paths config, unless there is some specific reason you have to (and if so, then at this moment you would need to clone the repo and make changes to all generateUrl calls in src/js). As said before, this app assumes install in default NC app location that has URL /apps. Meanwhile I have opened a question, so that custom paths might also be supported https://github.com/nextcloud/nextcloud-router/issues/450

anomaly256 commented 1 year ago

I honestly don't think I ever changed apps_path and I can't explain why it would have ended up there.

I've just now hit a nice landmine in nextcloud's official docker images though while trying to start with a fresh install

It's now a much fresher install than anticipated. I'll test your app again once the rsyncing of 15 years of family photos and movies from a slow NAS completes

anomaly256 commented 1 year ago

Working on the fresh install 👍, well it's loading the app anyway - closing this issue.

kroko commented 1 year ago

Meanwhile support was for custom app install location was added and pushed new 0.0.6 release, thus statements made in https://github.com/WARP-LAB/files_3dmodelviewer/issues/2#issuecomment-1443481808 are now untrue.